Sep-13-2018, 02:20 AM
(Sep-11-2018, 01:43 AM)test Wrote: Sir, it would be extremely helpful (not just for me, i think) if you could post your general thought process in figuring out what exactly has to be passed.
Thank you very much
For example, the following code just does not work again...
#wreqt.py import requests from bs4 import BeautifulSoup from lxml import html headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'} params = { 'acountName' : '*****', 'password' : '*****', 'useSrp' : 'false', 'publicA' : '', 'clientEvidenceM1' : "" } with requests.Session() as session: session.post('https://us.battle.net/login/en/', headers = headers, params = params) response = session.get('https://us.battle.net/account/management/') tree = html.fromstring(response.content) balance = tree.xpath('//*[@id="primary-balance"]') print(balance)Running this code outputs an empty list, while it should be the available balance for a user. As I am trying to learn the implementation for requests in general, and not just a specific case, can someone please explain how i can figure out what has to be passed to make it work everytime?