I'm trying to get specific data from the website below. There is only one form which is "Token Address". But I don't know how to extract the numbers shown after "Buy Tax:" and "Sell Tax:". I just need the numbers without the percent symbol. What is the cleanest way to extract this information using Python?
My failed attempt:
xPath_buy = /html/body/div/div[1]/div/p[5]/text()[1]
xPath_sell = /html/body/div/div[1]/div/p[5]/text()[2]
token = "0x40619dc9f00ea34e51d96b6ec5d8a6ad75457434"
url = "https://honeypot.is/?address=" + token
def tax(token):
url = "https://honeypot.is/?address=" + token
HTML = requests.get (url)
soup = BeautifulSoup(HTML.text, 'html.parser')
text = soup.find('div style', attrs={'xpath': '//*[@id="shitcoin"]/div/p[5]/text()[1]'})
return text
buy_tax = tax(token)
print(buy_tax)