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

Breaks Logs? #3

Open
bcrant opened this issue Feb 14, 2020 · 8 comments
Open

Breaks Logs? #3

bcrant opened this issue Feb 14, 2020 · 8 comments

Comments

@bcrant
Copy link

bcrant commented Feb 14, 2020

Hey,

Library is working great, but is printing dozens of this log line every time run:
Screen Shot 2020-02-13 at 6 56 11 PM

I've tried everything in my know how. Any one else experienced this?

import shadow_useragent ua = shadow_useragent.ShadowUserAgent() ua = ua.random_nomobile ua

Thanks!
-Brian

@lobstrio
Copy link
Collaborator

Hello @bcrant!

I have indeed experienced this in some cases. Or you using Jupyter notebook? Could you please share your notebook so I can have a look?
Thanks
Simon

@bcrant
Copy link
Author

bcrant commented Feb 14, 2020

Hey @lobstrio,

Thanks for getting back to me. I am using Jupyter Notebook through nbdev.

I am starting to suspect it has to do with running it inside of a For loop based on some experimentation. Still unable to resolve it, but moving it in/out of the for loop resulted in some variations to how the log kept erroneously running.

I've attached an operable version of the full script for your reference.

Cheers,
Brian
UA-log-error.ipynb.zip

@camnesia
Copy link

camnesia commented Mar 4, 2020

I am experiencing the same issue in the REPL, managed to recreate it by creating multiple instances.

@Kerni094
Copy link

Hi all,

Is there any update on this issue?

I also have a for loop where for each request I generate a new user-agent.
After a while I get thousands of these prints on the console.

@bcrant
Copy link
Author

bcrant commented May 24, 2020

@camnesia @Kerni094 I tried troubleshooting this for quite a while, but I eventually discovered that this package is nearly identical to a much more popular one called fake_useragent that works as described and does not have this problem with the log.

Maybe @lobstrio has some insight on the differences between the two, but I could not find any except for the fact that this one does not work.

@lobstrio
Copy link
Collaborator

@bcrant thanks for posting.

fake_useragent proposes much outdated user-agents, which did not satisfy our needs. Therefore we came up with this repo, based on real usage stats.

The users agents will from now be updated with the most recent one, every 10 days.

@lobstrio lobstrio reopened this Oct 15, 2020
@inthevortex
Copy link

I experience the same issue on a daily basis, I use it in my scrapy module. I had to suppress the logger at last.

@jayson-panganiban
Copy link

Encountered this as well and it is showing as error in logs

ERROR shadow-useragent MainThread : {'last_update': datetime.datetime(2020, 11, 9, 10, 28, 10, 902993, tzinfo=<DstTzInfo 'Europe/Paris' CET+1:00:00 STD>)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants