Reputation: 168
No results in the 2nd stage when running
print("========Stage One========")
url = url_string
page = requests.get(url)
soup2 = BeautifulSoup(page.content, 'html.parser') # Payload 2 soup value
results = soup2.find(id='list-container')
print(results.prettify())
print('========Stage Two========')
resultSections = results.find_all(class_='mobile-frame pull-left')
for resultSection in resultSections:
print(resultSection)
print("+"*10)
To Get HTML based on Class name (Achieved in stage one but not in stage 2)
Have information Sectioned Off per divider (<div class="">
)
In terms of what I got back after running this script was half of what I expected.
Stage One Worked as intended however Stage Two returned neither results or an error as seen here:
In terms of what things I tried included the following methods:
results.find_all(div, class_='mobile-frame pull-left') #Current
And
results.find(div, class_='mobile-frame pull-left') # Gives Error
Upvotes: 0
Views: 45
Reputation: 168
I seem to have found the solution to my problem.
It appears it gave me the browser emulated page for mobile rather then the computer site.
Refreshing the site gave me the class name of col-md-2 col-sm-3 col-xs-6
which I then used to replace mobile-frame pull-left
Doing this resulted in the desired data.
Upvotes: 1