seleniumbase / SeleniumBase

πŸ“Š Python's all-in-one framework for web crawling, scraping, testing, and reporting. Supports pytest. UC Mode provides stealth. Includes many tools.
https://seleniumbase.io
MIT License
5.2k stars 964 forks source link

webdriver classes conflict on enable `uc` and `wire` #2337

Closed d3cryptofc closed 10 months ago

d3cryptofc commented 10 months ago

I need to use wire mode and uc too, but...

βœ… It works

>>> driver = Driver(wire=True)
>>> driver.requests
[]

❌ It causes a webdriver class conflict

>>> driver = Driver(wire=True, uc=True)
>>> driver.requests
AttributeError: 'Chrome' object has no attribute 'requests'
mdmintz commented 10 months ago

Duplicate of https://github.com/seleniumbase/SeleniumBase/issues/2243#issuecomment-1797864769, https://github.com/seleniumbase/SeleniumBase/issues/1774#issuecomment-1444399269, https://github.com/seleniumbase/SeleniumBase/issues/2032#issuecomment-1693931853, https://github.com/seleniumbase/SeleniumBase/issues/2151#issuecomment-1741234068, etc.

Due to unresolved issues with selenium-wire: https://github.com/wkeeling/selenium-wire/search?q=undetected&type=issues, UC Mode and Wire Mode cannot be combined. Pick one or the other.

uesleivsouza commented 8 months ago

I need to use wire mode and uc too, but...

βœ… It works

>>> driver = Driver(wire=True)
>>> driver.requests
[]

❌ It causes a webdriver class conflict

>>> driver = Driver(wire=True, uc=True)
>>> driver.requests
AttributeError: 'Chrome' object has no attribute 'requests'

Did you find a way to make both work together? I am facing the same situation now.

mdmintz commented 8 months ago

https://github.com/seleniumbase/SeleniumBase/issues/2337#issuecomment-1838843884 still holds.

The best alternative involves getting the requests from CDP events. (See SeleniumBase/examples/uc_cdp_events.py for details.)

d3cryptofc commented 8 months ago

@uesleivsouza

Did you find a way to make both work together? I am facing the same situation now.

I didn't, infortunely.. also the CDP events doesn't have a HTTP response text, I needed it 😒

mdmintz commented 8 months ago

There’s also https://github.com/seleniumbase/SeleniumBase/issues/2220.

More info: https://stackoverflow.com/a/52636871/7058266

uesleivsouza commented 8 months ago

#2337 (comment) still holds.

The best alternative involves getting the requests from CDP events. (See SeleniumBase/examples/uc_cdp_events.py for details.)

Thank you for reply quickly, but unfortunately I think it can't fit to my application, I need to change the request, not only listen it .. I think I have to find another with external tools like proxy.