Learn practical skills, build real-world projects, and advance your career
Updated 9 months ago
🕸️ Web Scraping with Selenium and Beautiful Soup
import pandas as pd
from time import sleep
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from IPython import display
Driver instantiation and retrieving HTML data
url = 'https://www.sciencefocus.com/nature/why-do-we-find-puppies-so-cute/'
driver = webdriver.Chrome()
driver.get(url)
sleep(5)
html_data = driver.page_source