This guy has written some functionality to open a webpage in a browser from multiple unique ip addresses.
[login to view URL]
I want you to take this functionality, test it and write this in a python script.
The Script should be written in Python3.
The script should be run using command line and should accept the following parameters in command line arguments:
1. target_web_address - show clear error message if not a valid url or doesn't return a 200 response.
2. target_conversion_element (options: "form" or "button") - visitor submits that form or clicks that button.
3. target_conversion_element_id - visitor submits the form with that id or clicks the button with that id.
4. conversion_hint - a string that if present anywhere in the source code of that webpage, visitor will convert
5. num_converting_visitors - number of unique visitors that will convert.
6. converting_visitors_time_spent (acceptable format: (<num>,<num>) - script should arbitrarily select somewhere in this time range in seconds each converting visitor will spend on the site before converting
7. num_non_converting_visitors - number of unique visitors that will NOT convert.
8. non_converting_visitors_time_spent (acceptable format: (<num>,<num>) - script should arbitrarily select somewhere in this time range in seconds each NON converting visitor will spend on the site before closing the browser
In the above, the conversion means: visitor (i.e, selenium client) will convert i.e, submit the form of the given id or click the button of the given id.
Visitor should ONLY convert if the given `conversion hint` is present in the webpage source code.
Clear all sessions before starting selenium browser for each unique visitor. This is probably done automatially as hinted in the answer at that link: [login to view URL]
Show clear error message the webpage provided doesn't return a 200 response or doesn't load.
Show clear error message if the script user provides unsuitable values for the parameters in command line arguments.
Show clear error message if the given target_conversion_element or further target_conversion_element_id is not present in the webpage because this is supposed to be present in all of them.
Show clear error message if the given conversion hint is not found in any of the webpages opened because it is supposed to be present in atleast some of them.