I have a simple problem and I don't know how to settle it. I want to fill a form using rvest
where the input have no name:
library(rvest)
session <- html_session("https://www.tripadvisor.com/")
pgform <- html_form(session)[[1]]
> pgform
<form> 'global_nav_search_form' (GET /Search)
<input search> '':
<input text> '':
<button submit> 'sub-search
<input hidden> 'geo': 1
<input hidden> 'latitude':
<input hidden> 'longitude':
<input hidden> 'searchNearby':
<input hidden> 'pid': 3826
<input hidden> 'redirect':
<input hidden> 'startTime':
<input hidden> 'uiOrigin':
<input hidden> 'q':
<input hidden> 'supportedSearchTypes': find_near_stand_alone_query
<input hidden> 'enableNearPage': true
<input hidden> 'returnTo': __2F__
<input hidden> 'searchSessionId': C9C09F9043AE6FE69CE679DF8A44546D1547136702473ssid
<input hidden> 'social_typeahead_2018_feature': true
Here I would like to do a search by setting the input text, to have the link of the page. Of course if I do
filledform <- set_values(pgform, '' = "Paris")
I have an error :
Error: attempt to use zero-length variable name
I am sure there is a simple workaround, but I don't know it. Any idea ?
See Question&Answers more detail:os