-
Notifications
You must be signed in to change notification settings - Fork 47
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
Getting AttributeError when downloading pdf #14
Comments
Hi Javier,
Grace |
It appears to me, that sci-hub does not use the frames anymore. They utilize divs, see the example below.
PR with the quickfix below. |
simply replace |
Ok thank you :)
…On Mon, Oct 18, 2021 at 11:16 PM ddhecnu ***@***.***> wrote:
simply replace
pdf_url = soup.find('iframe', {'id': 'pdf'}).attrs['src'].split('#')[0]
with
pdf_url = soup.find('embed', {'id': 'pdf'}).attrs['src'].split('#')[0]
works for me
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIZADI5MZTWCNYFPX3SBDEDUHUELFANCNFSM5B27DBYA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi,I use python3.9 version , it occurs the same trouble like you mentioned above , and I followed your advise,however, it still didn't work @ddhecnu |
That’s weird there must be some kind of a problem with the iframe. I’m
not actually sure what the differences between 3.8 and 3.9. I commented an
alternate solution with a different website on the get hub page so thanks
for responding.
…On Sat, Nov 13, 2021 at 12:59 AM TongZhou Tao ***@***.***> wrote:
simply replace pdf_url = soup.find('iframe', {'id':
'pdf'}).attrs['src'].split('#')[0] with pdf_url = soup.find('embed',
{'id': 'pdf'}).attrs['src'].split('#')[0] works for me
Hi,I use python3.9 version , it occurs the same trouble like you mentioned
above , and I followed your advise,however, it still didn't work @ddhecnu
<https://github.com/ddhecnu>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIZADI2IZNO5JIOOUMGBMFTULYSGRANCNFSM5B27DBYA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I still get the error in some articles even with iframe to embed change
|
Great, what about a reproducible example? DOI maybe? I just randomly checked the sci-hub, and it seems fine. PDFs flourishing and resting in their embed lane. |
My bad. The errors were occurring in articles not yet available on scihub. I hadn't realized that was the problem. |
When I try to download an article using
I get the following error:
This didn't happen before. I am using Arch Linux, but also tried in a virtual machine with Linux Mint.
Accessing SciHub manually and downloading the article works.
The text was updated successfully, but these errors were encountered: