Selenium Firefox Webdriver Python Setup

 

Python Code

#Packages

from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
import csv
import re
from selenium import webdrive


#driver = webdriver.Firefox(capabilities={"marionette":False})
caps = webdriver.DesiredCapabilities.FIREFOX
caps["marionette"] = False
driver = webdriver.Firefox(capabilities=caps)


driver.get("https://www.google.com")

print (driver.title)

 

Python Code with Headless Firefox

#Packages

from bs4 import BeautifulSoup
import requests
import pandas as pd
import numpy as np
import csv
import re
from selenium import webdrive
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument("--headless")


#driver = webdriver.Firefox(capabilities={"marionette":False})
caps = webdriver.DesiredCapabilities.FIREFOX
caps["marionette"] = False
driver = webdriver.Firefox(capabilities=caps, firefox_options=options)


driver.get("https://www.google.com")

print (driver.title)

 


Leave a Reply

Your email address will not be published. Required fields are marked *

*