Python Forum
unable to lunch firefox using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unable to lunch firefox using python
#4
Look here for setup.
Can test again to make sure it work as,see the there extra step eg caps["marionette"] = True.
Can be False if using older FireFox browser.
Keep all update.
pip install -U selenium
FireFox ver 67.0
geckodriver-v0.24.0
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.keys import Keys
import time

#--| Setup
options = Options()
#options.add_argument("--headless")
caps = webdriver.DesiredCapabilities().FIREFOX
caps["marionette"] = True
browser = webdriver.Firefox(options=options, capabilities=caps, executable_path=r"geckodriver.exe")
#--| Parse or automation
browser.get('https://duckduckgo.com')
input_field = browser.find_elements_by_css_selector('#search_form_input_homepage')
input_field[0].send_keys(f'car{Keys.RETURN}')
time.sleep(3)
images_link = browser.find_elements_by_link_text('Images') # Name Images in your country
images_link[0].click()
time.sleep(5)
browser.quit()
So this work fine for me,also it open FireFox search for car and show images of cars.

I have to use this as it switch languages Bilder(Norway) == Images
browser.find_elements_by_link_text('Bilder')
Reply


Messages In This Thread
unable to lunch firefox using python - by sanjay - May-29-2019, 06:20 AM
RE: unable to lunch firefox using python - by snippsat - May-29-2019, 09:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The python DOT org cert problem and a new Firefox Skaperen 12 7,203 Nov-19-2017, 02:42 PM
Last Post: metulburr
  Peek preview of Firefox's WebRender Larz60+ 0 2,755 Oct-12-2017, 07:00 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020