I need a script written in Python that returns user agent strings from a list, and can give me information about the user agent.
The issue is that the user agents must be returned based on the share of the device type (Desktop vs. Mobile vs. Tablet. etc.), operating system version, and browser version that exists in the United States today.
To give an example, if 46.55% of Internet Users use Desktop/Laptop computers, and of that 46.55%, an additional 47.25% uses Windows 10. Of that Windows 10 share, 67.6% are using Chrome version 68 then it's most likely that this user agent is returned:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36
The idea is that if I run this script one million times, the distribution of user agents will be the exact breakouts I've described above--meaning some will be mobile, some will be Mac OSX and Firefox version 60.
From my perspective, you need to do three things to accomplish this:
1. Scrape all of the user agents known to man--this can be done pretty easily here:
[login to view URL]
2. Get the device, os and browser share online. I got the information from this link: [login to view URL] but any source will do so long as it's correct.
3. I should also be able to tell in some way the device, os, os version, browser and browser version of the string, almost like a built-in parser.
The fake user agent library in Python might be illustrative, but I want my script to do more:
[login to view URL]
If you bid please include the words "tricky problem" or else I'll know you never actually read the description and your bid will be rejected.
Hi, dear! I'm a full-time, Desktop App / Security product developer with 9+ years of development experience for Windows / Linux / MacOS.
I have a master degree in Computer Science.
Especially I have solid skill and experience with Python / Qt / Java / C# and etc.
Let me discuss in detail via chat / voice call.
I can speak English and Chinese fluently.
Best regards.