[Tutor] Webbrowser's capabilities to do more than just open up a webpage
Stephen M Smith
stephen.m.smith at comcast.net
Mon Aug 31 14:08:17 EDT 2020
I am having trouble with various websites detecting the usage of python,
selenium and chrome and rejecting my request to make reservations
automatically. I am not scraping or in any way violating information that
anyone could or would consider private or proprietary. I have read through
all of the questions i can find (
<https://stackoverflow.com/questions/58873022/how-to-make-selenium-script-un
detectable-using-geckodriver-and-firefox-through-p> How to make Selenium
script undetectable using GeckoDriver and Firefox through Python? - to cite
one) and have tried most if not all of the recommendations. I continue to
experiment with combinations of what is suggested, but have not found the
answer yet.
However, it occurs to me that using the python webbrowser module directly
would allow me to eliminate the middleman (selenium) and keep my usage
clean. (Using wireshark i can see that the header sent with webbrowser
appears to be exactly the same as the header sent when i invoke chrome
manually, with selenium it is different.) However, webbrowser does not seem
to have the ability to fill in forms, 'press' buttons and locate and
interact with various elements. In other words, I need to be able to
manually create the click, switch_to_frame, xpath_search,
find_element_by_class_name, etc. functions provided by selenium. I first
hoped that these capabilities would be available in webbrowser, but that
seems to be wrong. Then i thought that perhaps i could look through the
selenium code and learn how those capabilities were provided and
borrow/copy, but that has proven to be difficult. Finally i thought perhaps
i could use webbrowser to get started, and then introduce selenium to query
the site opened natively (with webbrowser), but i can't figure out if that
is possible and am not sure that will work.
I am hoping someone out there more knowledgeable than me can point me in the
right direction. I know i may be biting off a lot, but i am basically a
python hobbyist and am enjoying the learning process.
Thanks as always for any and all help provided.
More information about the Tutor
mailing list