We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CCing issue above issue discovered from posting to stack overflow:
https://stackoverflow.com/questions/79267016/how-to-properly-perform-an-xpath-english-text-search-with-r-package-rvest-doesn/79268974#79268974
library(rvest) library(dplyr) test <- read_html_live("https://www.cdc.gov") # single-quotes in xpath, no match: html_elements(test, xpath = "//a[contains(text(),'Outbreaks')]") #> {xml_nodeset (0)} # swap quotes, " <-> ' html_elements(test, xpath = '//a[contains(text(), "Outbreaks")]') #> {xml_nodeset (3)} #> [1] <a href="https://www.cdc.gov/outbreaks/index.html">Outbreaks</a> #> [2] <a href="https://www.cdc.gov/outbreaks/index.html" class="btn btn-outline ... #> [3] <a href="https://www.cdc.gov/outbreaks/index.html" class="btn btn-outline ...
Perhaps a note about the needed single quotation starting order to an xpath could be added to the rvest documentation Fyi
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CCing issue above issue discovered from posting to stack overflow:
https://stackoverflow.com/questions/79267016/how-to-properly-perform-an-xpath-english-text-search-with-r-package-rvest-doesn/79268974#79268974
Perhaps a note about the needed single quotation starting order to an xpath could be added to the rvest documentation
Fyi
The text was updated successfully, but these errors were encountered: