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

nod calls bow with wrong arguments #31

Closed
wmay opened this issue Jul 27, 2020 · 2 comments · Fixed by #42
Closed

nod calls bow with wrong arguments #31

wmay opened this issue Jul 27, 2020 · 2 comments · Fixed by #42
Labels
enhancement New feature or request

Comments

@wmay
Copy link

wmay commented Jul 27, 2020

nod calls bow with the wrong arguments when the URL subdomain changes, causing it to throw an error.

Here's a short reproducible example:

url1 = 'https://essd.copernicus.org/articles/search.html'
url2 = 'https://seeker.copernicus.org/search.php?abstract=atmospheric+chemistry&startYear=2008&endYear=2020&paperVersion=final&journal=386&page=1'
bow(url1) %>% nod(url2)
@dmi3kno
Copy link
Owner

dmi3kno commented Jul 27, 2020

Thank you for your question. nod() is intended to "modify the path" not define it anew. In this case you need to bow() to the new url:

library(polite)
url1 = 'https://seeker.copernicus.org/'
url2 = 'https://seeker.copernicus.org/search.php?abstract=atmospheric+chemistry&startYear=2008&endYear=2020&paperVersion=final&journal=386&page=1'

bow(url1) %>% nod(url2)
#><polite session> https://seeker.copernicus.org/search.php
#>    User-agent: polite R package
#>    robots.txt: 1 rules are defined for 1 bots
#>   Crawl delay: 5 sec
#>  The path is scrapable for this user-agent

Having said that, I agree that the error message you are getting is not informative and I should improve it. Will close the issue once the error message is improved.

@wmay
Copy link
Author

wmay commented Jul 28, 2020

Fair enough. I will adjust my code accordingly.

@dmi3kno dmi3kno added the enhancement New feature or request label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants