Answer the question
In order to leave comments, you need to log in
How to find a list of the same type of links on the site?
Disclaimer: very amateurish question ;-(
There is a site that contains a table, one of the columns of which has links that start the same way. How can I get a list of these links?
Here are my attempts:
import requests
from bs4 import BeautifulSoup
page = requests.get(
'https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html')
soup = BeautifulSoup(page.text, 'html.parser')
wallets = soup.findAll('a', href="https://bitinfocharts.com/bitcoin/address/[\w]+")
print(wallets)
Answer the question
In order to leave comments, you need to log in
cut it myself :-D
import requests
from bs4 import BeautifulSoup
import re
page = requests.get(
'https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html')
soup = BeautifulSoup(page.text, 'html.parser')
pattern = r"https://bitinfocharts.com/bitcoin/address/[\w]+"
wallets = re.findall(pattern, str(soup))
print(wallets)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question