【发布时间】:2014-11-19 19:02:49
【问题描述】:
我正在尝试使用包含片段标识符的请求模块发送 GET 请求。我有以下代码:
url = 'http://steamcommunity.com/market/search?appid=730#p20_quantity_desc'
page = requests.get(url, headers=headers)
但是,我最终总是得到基本页面 (http://steamcommunity.com/market/search?appid=730),而不是带有片段标识符的页面(似乎没有发送 #p20_quanitity_description)。
urllib2 也不适用于我的代码:
req = urllib2.Request(url, headers={ 'User-Agent': 'Mozilla/5.0' })
page = urllib2.urlopen(req).read().decode('UTF-8', 'ignore')
我将如何发送 GET 请求并在 URL 中包含 #p20_quanitity_description?
【问题讨论】: