5

I have been trying to do web automation using Selenium. Is there any way to use a browser like Chrome or Firefox without actually installing them, like using some alternate options, or having portable versions of them. If I can use portable versions how do I tell Selenium to use it?

1
  • This comment is to get the attention of experienced developers to get an updated answer. I'll delete it soon. Commented Aug 4, 2022 at 7:20

2 Answers 2

1

To use the browsers like and you have to install the full-blown browser.

You can find a detailed discussion in Is Chrome installation needed or only chromedriver when using Selenium?


As an alternative you can use the headless browser as follows:

  • Code Block:

    from selenium import webdriver
    
    driver = webdriver.PhantomJS(executable_path=r'C:\WebDrivers\phantomjs.exe', service_args=['--ignore-ssl-errors=true', '--ssl-protocol=tslv1.0'])
    driver.set_window_size(1920, 1080)
    driver.get("https://account.booking.com/register?op_token=EgVvYXV0aCJ7ChQ2Wjcyb0hPZDM2Tm43emszcGlyaBIJYXV0aG9yaXplGhpodHRwczovL2FkbWluLmJvb2tpbmcuY29tLyo2eyJwYWdlIjoiL3JlZGlyZWN0LXRvLWpvaW5hcHAtbHA_bGFuZz1pdCZhaWQ9MTE4NzM2MCJ9QgRjb2RlKg4QAToAQgBY5dGK8gVgAQ")
    print(driver.page_source)
    driver.quit()
    

You can find a detailed discussion in PhantomJS can't load correctly web page


References

A couple of relevent discussions:

Sign up to request clarification or add additional context in comments.

4 Comments

Isn't Phantom dead?
phantom is dead. good luck guys. i hope there's alternative to this problem
@undetected Selenium phantom is dead, can you provide some alternative? It doesn't have to selenium, any portable library would do actually.
@CyberAvater BeautifulSoup/Requests either will be a good candidate. Even Headless Chrome/Headless Firefox
-1

Install Selenium typing pip install selenium.

It comes with a portable version of Chrome browser, no need to manually install any browser for this.

Chrome will show this message to indicate that it is being 'remote controlled:

"Chrome is controlled by automated test software"

4 Comments

But still your machine has to have a chrome browser to open from selenium code!!
yeah its a different version of chrome , it doesn't need your usual chrome browser
it will automatically comes inside python libs
As others said, check this. stackoverflow.com/questions/53330322/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.