kaliiiiiiiiii / Selenium-Driverless

undetected Selenium without usage of chromedriver
https://kaliiiiiiiiii.github.io/Selenium-Driverless/
Other
412 stars 52 forks source link

Working nice, but some questions... #3

Closed ruslanx3m closed 11 months ago

ruslanx3m commented 11 months ago
  1. how to set a proxy with authentication ?
  2. how to set path to chromedriver in options ?
  3. how to set user-agent ?

can you give some example, 2 days from javascript, node js how I came to python only for this lib ... it's passing cloudflare ... is a same or (puppeteer, playwright) .. in node js lib ? thank you.

kaliiiiiiiiii commented 11 months ago
  1. use this package with selenium-profiles and selenium-injector: proxies can be set in the profile or dynamically
    
    from selenium_profiles.webdriver import Chrome
    from selenium_profiles.profiles import profiles

profile = profiles.Windows() # or .Android() profile["proxy"] = { "proxy":"http://user1:pass1@example_host.com:41149" }

driver = Chrome(profile=profile, injector_options=True, driverless_options=True)

driver.profiles.proxy.set_single("http://user2:pass2@example_host.com:41149") print(driver.profiles.proxy.proxy)

driver.quit() # Execute on the End!



2. You can't as Selenium-Driverless connects to Chrome directly, without the use of `chromedriver`. Therefore, chromedriver isn't needed
3. use with selenium-profiles again. For possile profile-settings, have a look at [example-profile](https://github.com/kaliiiiiiiiii/Selenium-Profiles#profiles). Note that changing the UserAgent might make you getting detected

> can you give some example

a lot of the syntax is the same as with selenium itsself. Therefore you can have a look at its [documentation](https://selenium-python.readthedocs.io/getting-started.html) or [selenium-profiles-documentation](https://github.com/kaliiiiiiiiii/Selenium-Profiles) or [selenium-injector](https://github.com/kaliiiiiiiiii/Selenium-Injector) documentation

> it's passing cloudflare ...

yes, indeed, that's the point of this package.

> is a same or (puppeteer, playwright) .. in node js lib ?

Do you mean if there's a similar package for node-js (javascript) ? No, not as I know yet. It surely would be possible, but requires some development.

Note: feel free to ask further questions. Also, please make use of the Discussion section