Created
April 22, 2021 10:19
-
-
Save EdwinTai/2898f15dddac66281abe71d9c38af4d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from selenium import webdriver | |
from bs4 import BeautifulSoup | |
driver = webdriver.Chrome() | |
url = "https://tw.sports.yahoo.com/" #specific download url | |
driver.get(url) | |
time.sleep(5) #wait until page load finish | |
soup = BeautifulSoup(driver.page_source,'html.parser') | |
for content in soup.find_all('h3', {'class': 'M(0)'}): | |
print(content.text) | |
driver.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment