简体   繁体   中英

How to scrap a loading item in pyhton

I can't manage to scrape the dev github links on some coingecko's pages for it displays "loading" as output of the request. I've tried with request.get("https://www.coingecko.com/en/coins/solpatrol-bail")

Here the code:

import requests
from bs4 import BeautifulSoup

res=requests.get("https://www.coingecko.com/en/coins/solpatrol-bail#developer")
cres=BeautifulSoup(res.text,'html.parser')
dev=cres.find_all("div", attrs={"id":"developer"})
dev

If someone has any idea on how to solve this I would be grateful thanks!

It appears that the developer tab is loaded from this url: https://www.coingecko.com/en/coins/25787/developer_tab . Which would make:

import requests
from bs4 import BeautifulSoup

res=requests.get("https://www.coingecko.com/en/coins/25787/developer_tab")
cres=BeautifulSoup(res.text,'html.parser')
dev=cres.find("a")['href']
dev

Output:

'https://github.com/SolPatrol/'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM