Hi I'm currently trying to scrape this https://www.sec.gov/ix?doc=/Archives/edgar/data/1090727/000109072720000003/form8-kq42019earningsr.htm SEC link with beautifulsoup to get the link containing "UPS"
pressting = soup3.find_all("a", string="UPS")
linkkm = pressting.get('href')
print(linkkm)
But when I do this I get this error:
Traceback (most recent call last):
File "C:UsersAdminAppDataLocalProgramsPythonPython36SEC.py", line 55, in <module>
print('Price: ' + str(edgar()))
File "C:UsersAdminAppDataLocalProgramsPythonPython36SEC.py", line 46, in edgar
linkkm = pressting.get('href')
File "C:UsersAdminAppDataLocalProgramsPythonPython36libsite-packagess4element.py", line 2081, in __getattr__
"ResultSet object has no attribute '%s'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?" % key
AttributeError: ResultSet object has no attribute 'get'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
My expected result is to exract the href and then print that href. Any help would be appreciated.
See Question&Answers more detail:os