Issue
I can't get all of it. Many elements are empty. I was told that it was the case because it was js code and bs4 can't read js and I had to use selenium instead, but I want to do it with bs4 and I know there is a way to do so. I also was told that it was the case, because I wasn't in the correct iframe, but I doesn't seem to be true. For example if you inspect one of the prices listed (e.g $2,200/mo) you will see that it is contained in a ul list and each apartment listed is a li element of that list. But when I scrape the page with bs it seems that most of these li elements are empty. Also, bear in mind I'm a newbie in web-scraping and in python, so be cool please. Thanks!
Here is the code I'm using to get the page html:
self.response = requests.get(url=URL, headers=headers)
self.html_doc = self.response.text
self.soup = BeautifulSoup(self.html_doc, 'html.parser')
Solution
It appears that I have to use selenium in order to do the work. Thanks all for you participation!
Answered By - younes alaoui
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.