Skip to content

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

@rohlfs

Description

@rohlfs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions