I use this code to access my link:
links = soup.find("span", { "class" : "hsmall" })
links.findNextSiblings('a')
for link in links:
print link['href']
print link.string
The link does not have an identifier or class or anything else, it is just a classic link with the href attribute.
My script answer:
print link['href']
TypeError: string indices must be integers
Can you help me get the href value? thank!
source
share