Warm tip: This article is reproduced from stackoverflow.com, please click
button python-3.x selenium web-scraping developer-tools

Download csv with Python scraping button in dynamic web page

发布于 2020-03-29 20:59:35

I would like to download a csv from this web page (https://biwenger.as.com/la-liga/players) with python.

There is an option (image attached) that you can download this csv, but I would like to get it programatically.

I don't know how to use Chrome > Developer Tools > Network to see where it gets the data. Can anybody help me?

Should I use Selenium to perform this actions?

Many thanks!

enter image description here

Questioner
nurasaki
Viewed
183
Tek Nath 2020-01-31 18:16

If you are looking for in simple Selenium. I did the following.

driver = webdriver.Chrome("/driver/path")

driver.get("https://biwenger.as.com/la-liga/players")

driver.find_element_by_xpath("//div[3]/button/i").click()
driver.find_element_by_xpath("//a[contains(.,' Export')]").click()
sleep(10)