0

I am still a beginner in python and I am trying to scrape a website, I would like Python to search for a value until it is visible, therefore retry until the value is available rather than giving error 'AttributeError: 'ResultSet' object has no attribute 'get' if no value is found. This is my code right now:

resumeURL='url'
response=self.session.get(resumeURL,headers=headers)
soup=BeautifulSoup(response.content, "html.parser")

form=soup.find_all('input',{'name':'form_id', 'type':'hidden'})
for form in form:
print(form.get('value'))
Sid
  • 61
  • 4
  • 10
  • Short answer: Use selenium to load dynamic content Ref: https://stackoverflow.com/questions/17597424/how-to-retrieve-the-values-of-dynamic-html-content-using-python – northtree Feb 27 '18 at 23:25

1 Answers1

0

You have to render dynamic content.

Options:

  1. selenium, https://github.com/SeleniumHQ/selenium
  2. Requests-HTML: HTML Parsing for Humans, https://github.com/kennethreitz/requests-html#requests-html-html-parsing-for-humans
northtree
  • 8,569
  • 11
  • 61
  • 80