Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R: harvesting data with rvest fail - consecutive html-forms #29

Closed
rohlfs opened this issue Dec 3, 2014 · 0 comments
Closed

R: harvesting data with rvest fail - consecutive html-forms #29

rohlfs opened this issue Dec 3, 2014 · 0 comments

Comments

@rohlfs
Copy link

@rohlfs rohlfs commented Dec 3, 2014

The advanced search from a railway timetable databas fails. This is only aviable after a foregoing form submit.

url     <- "http://mobile.bahn.de/bin/mobil/query.exe/dox?country=DEU&rt=1&use_realtime_filter=1&webview=&searchMode=NORMAL"
von     <- "HH"
nach    <- "F"
sitzung <- html_session(url)
p1.form <- html_form(sitzung)[[1]]
p2      <- submit_form(sitzung, p1.form, submit='advancedProductMode')
p2.form <- html_form(p2)[[1]]
form.mod<- set_values( p2.form
                      ,REQ0JourneyStopsS0G     = von
                      ,REQ0JourneyStopsZ0G     = nach
                      )
final   <- submit_form(p2, form.mod, submit='start')

Error in vapply(elements, encode, character(1)) :
values must be length 1,
but FUN(X[[18]]) result is length 0

Same result with:

submit_form(p2, form.mod, submit='start')

See also:

http://stackoverflow.com/posts/27251705/revisions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant