Python 3 Web Scraping中的HTTP错误403
我试图通过抓取网站进行练习,但是我一直收到HTTP错误403(它认为我是机器人)吗? 这是我的代码: #import requests import urllib.request from bs4 import BeautifulSoup #from urllib import urlopen import re webpage = urllib.request.urlopen('http://www.cmegroup.com/trading/products/#sortField=oi&sortAsc=false&venues=3&page=1&cleared=1&group=1').read findrows = re.compile('<tr class="- banding(?:On|Off)>(.*?)</tr>') findlink = re.compile('<a href =">(.*)</a>') row_array = re.findall(findrows, webpage) links = re.finall(findlink, webpate) print(len(row_array)) iterator = [] 我得到的错误是: File "C:\Python33\lib\urllib\request.py", line 160, in urlopen return opener.open(url, …