Jul-03-2021, 05:49 PM
(Jul-03-2021, 04:02 PM)snippsat Wrote:(Jul-03-2021, 02:34 PM)Mike_Eddy Wrote: Is it possible to scrap data from a website where the data came from a javascript call.Yes the easiest way is to use Selenium,there are many Thread about this here if search.
Can also look at Web-scraping part-2.
To give a example.
from selenium import webdriver from selenium.webdriver.chrome.options import Options from time import sleep #--| Setup options = Options() #options.add_argument("--headless") browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe', options=options) #--| Parse or automation url = "http://www.footlive.com/" browser.get(url) sleep(2) score = browser.find_elements_by_css_selector('#game_1052957 > table > tbody > tr > td:nth-child(3)')[0] print(score.text)
Output:Brazil 1 : 0 Chile
thank you