-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Fix issues
Hard Code of path to the browser driver:
| geckodriver_path = '/snap/bin/geckodriver' |
There is no assurances in FireFox installation:
| driver = webdriver.Firefox(service=service, options=options) |
Need to lib for dynamic using
pip install webdriver-managerSample usecase, if installed Google Chrome browser
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(ChromeDriverManager().install())Or FireFox
from selenium import webdriver
from webdriver_manager.firefox import GeckoDriverManager
driver = webdriver.Firefox(executable_path=GeckoDriverManager().install())TODO task
Better parse data by BeautifulSoup tool + sample
pip install requests beautifulsoup4import requests
from bs4 import BeautifulSoup
url = "http://example.com"
response = requests.get(url)
if response.status_code == 200:
soup = BeautifulSoup(response.text, 'html.parser')
title = soup.title.string
print(f"Title of the page: {title}")
links = soup.find_all('a')
for link in links:
print(link.get('href'))
else:
print(f"Failed to retrieve page: {response.status_code}")Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working