I'm scraping a list of restaurants from a website (with permission) and I have a problem. The html python scrapes from the website is different from the html in the source code. Less then half of the restaurants on their site are found in the html in python. This is what my code looks like:
import requests
from bs4 import BeautifulSoup
from tempfile import TemporaryFile
import xlwt
url = 'https://www.example.com'
r = requests.get(url)
data = BeautifulSoup(r.text)
soup = data.find_all('span',{'class':'restaurant_name'})
print soup
Now I know it's incovenient, but I can't show the html since the company won't let me. I'm just wondering whether you guys in general know how the html downloaded by python can be different from the one in the source code and what I can do about it.
Thanks in advance!