Python web crawling error :"DistutilsPlatformError: Unable to find vcvarsall.bat" -
i wrote simple web crawling code, crawls craigslist. after defining "single_item_data", result breaks down , says "distutilsplatformerror: unable find vcvarsall.bat" 1 can explain reason why? thank responding question!
import requests bs4 import beautifulsoup def trade_spider(max_page): page = 1 while page <= max_page: url = 'https://seoul.craigslist.co.kr/search/apa?s=%s' % max_page source_code = requests.get(url) plain_text = source_code.text soup = beautifulsoup(plain_text) link in soup.findall('a', {'class' : 'result-title hdrlnk'}): href = 'https://seoul.craigslist.co.kr' + link.get('href') title = link.string get_single_item_data(url) page += 1 def get_single_item_data(item_url): source_code = requests.get(item_url) plain_text = source_code.text soup = beautifulsoup(plain_text) itenm_name in soup.findall('span', {'class' : 'postingtitletext'}): print(item_name.string) trade_spider(1)
Comments
Post a Comment