So for improving my scraping skills, I have been trying to download the document present in https://ikeacatalogues.ikea.com/sv-1950/page/1 but when ever I am trying to get div either with or without id, all I am getting is <div id="fakescroll"</div> and what I want is the direct link to the document which is present in an anchor tag
I am not able to access it either. I tired to find all the link present in the webpage and it is returning an empty list.
Please help. Here is my code. This code return empty output:
from bs4 import BeautifulSoup
from selenium import webdriver
url = "https://ikeacatalogues.ikea.com/sv-1950/page/1"
browser = webdriver.Chrome(executable_path="/path/to/chromedriver.exe")
browser.get(url)
soup = BeautifulSoup(browser.page_source,"html.parser")
items=soup.select(""div", {"id": "main_menu"}")
print(items)
Here is my code for getting all the href. The output is empty.
import httplib2
from bs4 import BeautifulSoup, SoupStrainer
http = httplib2.Http()
status, response = http.request('https://ikeacatalogues.ikea.com/sv-1950/page/1')
for link in BeautifulSoup(response, parse_only=SoupStrainer('a')):
if link.has_attr('href'):
print(link['href'])