[ad_1]
Im trying to print the first element of “Contract Name” however it prints 25 times (the total number of rows) and i i search for another index within the range it doesnt work. I downloaded it to a csv file in order to check the index and it is fine there but not in the code.
[CSV View][1]
scraper = cloudscraper.create_scraper(delay=10, browser="chrome")
url = "https://etherscan.io/contractsVerified"
info = scraper.get(url).text
soup = beauty(info, "html.parser")
table = soup.find('table', attrs={'class':'table table-hover'})
table_body = table.find('tbody')
rows = table_body.find_all('tr')
l = []
for tr in rows:
td = tr.find_all('td')
row = [tr.text for tr in td]
l.append(row)
gatu = pd.DataFrame(l, columns=["Address","Contract Name","Compiler","Version","Balance","Txns","Setting","Verified","Audited","License"])
x = gatu.iloc[0]
row_1 = gatu["Contract Name"].iloc[0]
print(x)
print (row_1)```
[1]: https://i.stack.imgur.com/cwWkd.png
[ad_2]