How to implement Site Key & Client ID in request session

痴心易碎 提交于 2020-01-17 07:08:25

问题


I'm running phantomJS and using it to scrape a website for its 'client id' and 'site key'. And I want to implement the site key & client id into a request session in python to have access to the same webpage i did in the PhantomJS browser session. Any tips on how to accomplish this using requests in python.

Please note that I've already figured out how to scrape the website, I just don't understand how to implement the SITE KEY & CLIENT ID into my python request session!

Here's what I tried,

client id: '842085ea-09be-46e0-b0b4-9d7535ad5b69'  

 site key: '6Ler0hUUAAAAANikfVz6I1o0Mdzj0hwX2XFsl4Oy'  
headers = {
            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36',
            'Accept-Encoding': 'gzip, deflate, sdch, br',
            'Accept-Language': 'en-US,en;q=0.8',
            'Upgrade-Insecure-Requests': '1'
        }

requests.get('http://www.adidas.com/us/pureboost-shoes/CG2986.html' , headers=headers, auth=HTTPBasicAuth('842085ea-09be-46e0-b0b4-9d7535ad5b69','6Ler0hUUAAAAANikfVz6I1o0Mdzj0hwX2XFsl4Oy')

here

来源:https://stackoverflow.com/questions/44511507/how-to-implement-site-key-client-id-in-request-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!