次のコードでデータをスクレイピングしようとすると:
from bs4 import BeautifulSoup
import urllib2
import requests
import re
start_url = requests.get('http://www.indiaproperty.com/chennai-property-search-allresidential-properties-for-sale-in-velachery-results')
soup = BeautifulSoup(start_url.content)
properties = soup.findAll('a',{'class':'paddl10'})
for eachproperty in properties:
print eachproperty['href']
出力が表示されません。エラーも発生しません。次のコードを使用してリダイレクトされているかどうかを確認しました
from bs4 import BeautifulSoup
import requests
response = requests.get('http://www.indiaproperty.com/chennai-property-search-allresidential-properties-for-sale-in-velachery-results')
response.url
その後、何も表示されず、エラーも表示されません。