I am using python 3.12.1 and VS code. This is my first time trying to web scrape and I cannot get chrome driver to run on chrome without it crashing almost immediately. It does not work in Mac terminal either.
I was following a youtube tutorial for web scraping, I am a beginner to python. The definition for chrome_driver_path, chrome_options, and chrome_options.binary_location were me trying to fix the bug. The Chrome for testing only launches for the amount of time I have sleep set to.
My Code:
from time import sleep
import pandas as pd
from selenium import webdriver
from bs4 import BeautifulSoup
import os
chrome_driver_path = "/usr/local/bin/chromedriver"
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = "/Desktop/Code/Python/Projects/WebScrapeFlights/GC-for-Testing.app"
driver = webdriver.Chrome(options = chrome_options)
to_location = 'MAD'
url = 'https://www.kayak.com/flights/PHL,EWR,JFK-{to_location}/2024-05-15/2024-06-21?sort=bestflight_a'.format(to_location = to_location)
driver.get(url)
sleep(10)