我在下面有这个链接(freepome+top有+替换一个空格)
https://poshmark.com/search?query=freepeople+top&type=listings&department=Women
我这样做是为了查询链接:
search='https://poshmark.com/search?'
brand="freepeople"
style="top"
# & seperates parameters
queryParameters={'query':[brand,style],'type':'listings','department':'Women'}
response=requests.get(search,params=queryParameters)
我不明白为什么我打印的时候(回复.text)它似乎给了我所有的html,但当我这样做:
MacBook-Air-4:finalproject BCohen$ python3 poshmart.py >/tmp/poshmart.html
MacBook-Air-4:finalproject BCohen$ open /tmp/poshmart.html
它不会把我带到一个有效的页面
我假设我可能查询了索引搜索(the+)错误,但我不确定如何正确地查询它。你知道吗
可以使用
'+'.join([brand,style])
将该数组转换为一个字符串,其中值与+
连接。结果就是你想要的:freepeople+top
输出为
它在第二次打印中显示为
%2B
的原因是因为这是+
的urlencoded值相关问题 更多 >
编程相关推荐