GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — Resolve redirects when testing URLs for equality by hseg · Pull Request #3 · papis/python-doi ConversationThe URL DOIs resolve to can move around, with redirects pointing to the new location. To make the tests more robust, only fail if the URLs differ after redirections. See also https://www.crossref.org/blog/urls-and-dois-a-complicated-relationship/ and item 10 in https://pardalotus.tech/posts/2024-10-02-falsehoods-programmers-believe-about-dois/
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
hseg
force-pushed
the
canonicalize_urls
branch
2 times, most recently
from
289b398 to
c67beee
Compare
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Closed
The URL DOIs resolve to can move around, with redirects pointing to the new location. To make the tests more robust, only fail if the URLs differ after redirections. See also https://www.crossref.org/blog/urls-and-dois-a-complicated-relationship/
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
OK, import cloudscraper scraper = cloudscraper.create_scraper() print(scraper.get('http://aip.scitation.org/doi/10.1063/1.5081715').url) # https://pubs.aip.org/aip/jcp/article-abstract/150/7/074102/197572/Exact-two-component-equation-of-motion-coupled?redirectedFrom=fulltext |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
7cfe04a to
b161e62
Compare
There was an error while loading. Please reload this page.
|
OK, added a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Also put in a fallback using requests, but it is hacky and only works sometimes. cloudscraper stands a better chance of consistently being able to get to the final URL
This eg makes it easier to spot which particular iteration breaks
|
Note this still isn't perfect -- my testing must've gotten my on scitation's warnlist, because I'm starting to get redirected to their captcha page. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So I tried to investigate this further today, see if I could make the test more robust. EDIT: Reading further on that page, it seems that among the multiple valid URLs for the DOI, there will always be a "primary" URL, which can obtained by adding |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
From what I've seen this seems fine, thank you for your work, what do you think @alexfikl ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@alejandrogallo Yeah, this looks good to me too! It doesn't seem like we can do much better these days + scraping seems to be disallowed more and more with AI wreaking havoc all over the place :( It also includes #2, so I'll go ahead and close that.
Might be worth looking for some other website then? The main point is to test that the DOI detection in the library works.. not necessarily that it works with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Only concern I have remaining is multiple resolution, but we could reopen that as a new issue - idk how much work it'd be to support that.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.