shadow-useragent
shadow-useragent copied to clipboard
Breaks Logs?
Hey,
Library is working great, but is printing dozens of this log line every time run:

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
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
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
I am experiencing the same issue in the REPL, managed to recreate it by creating multiple instances.
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.
@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.
@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.
I experience the same issue on a daily basis, I use it in my scrapy module. I had to suppress the logger at last.
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>)}