Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Requests login failure
#8
(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 Smile

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?
Reply


Messages In This Thread
Requests login failure - by test - Sep-09-2018, 06:34 AM
RE: Requests login failure - by test - Sep-09-2018, 03:35 PM
RE: Requests login failure - by test - Sep-09-2018, 05:05 PM
RE: Requests login failure - by test - Sep-10-2018, 02:36 AM
RE: Requests login failure - by test - Sep-10-2018, 03:52 PM
RE: Requests login failure - by snippsat - Sep-10-2018, 06:01 PM
RE: Requests login failure - by test - Sep-11-2018, 01:43 AM
RE: Requests login failure - by test - Sep-13-2018, 02:20 AM
RE: Requests login failure - by test - Sep-13-2018, 03:35 AM
RE: Requests login failure - by snippsat - Sep-13-2018, 07:58 AM
RE: Requests login failure - by test - Sep-13-2018, 08:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  POST requests - different requests return the same response Default_001 3 1,964 Mar-10-2022, 11:26 PM
Last Post: Default_001
  How to perform a successful login(signin) through Requests in Python Kalet 1 2,363 Apr-24-2020, 01:44 AM
Last Post: Larz60+
  HOWTO? Login DSL Modem with Python Requests: need Click "Apply" Button Webtest 4 8,529 Aug-20-2019, 04:03 PM
Last Post: johnmina
  Using python requests module and BS4 to login on an Wordpress based website apollo 1 9,447 Feb-06-2018, 01:31 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020