Python Forum
requests problem in python script "content type"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
requests problem in python script "content type"
#4
Remove .text end of line 12.
But looking at site so will this not work.
This is from data send:
email: [email protected]
ba1aadd6: 4xxxx
_nnc: 3:15xxxxxxxx
submit: Submit
So need to parse out this values or it will not work.
I think using selenium will be easier here,then should not need to find these values.

How setup for Requests would look.
import requests
from bs4 import BeautifulSoup
 
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
}
 
# Need to first find ba1aadd6 and _nnc vaules first
params = {
    email: [email protected]
    ba1aadd6: 4xxxx
    _nnc: 3:15xxxxxxxx
    submit: Submit
}
 
with requests.Session() as s:
    s.post('https://www.etsy.com/forgot_password?email=', headers=headers, params=params)
    # logged in! session cookies saved for future requests
    response = s.get('https://www.etsy.com/forgot_password?email=')
    # cookies sent automatically!
    # Example send to BS
    soup = BeautifulSoup(response.content, 'lxml')
    #welcome = soup.find('title').text
    #print(welcome)
Reply


Messages In This Thread
RE: requests problem in python script "content type" - by snippsat - Dec-29-2019, 11:33 AM
for loop problem in py - by abdlwafitahiri - Dec-29-2019, 02:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Retrieve website content using Python? Vadanane 1 1,276 Jan-16-2023, 09:55 AM
Last Post: Axel_Erfurt
  POST requests - different requests return the same response Default_001 3 1,956 Mar-10-2022, 11:26 PM
Last Post: Default_001
  Python Obstacles | Krav Maga | Wiki Scraped Content [Column Copy] BrandonKastning 4 2,239 Jan-03-2022, 06:59 AM
Last Post: BrandonKastning
  Python Obstacles | Kapap | Wiki Scraped Content [Column Nulling] BrandonKastning 2 1,736 Jan-03-2022, 04:26 AM
Last Post: BrandonKastning
  Python Web Scraping can not getting all HTML content yqqwe123 0 1,649 Aug-02-2021, 08:56 AM
Last Post: yqqwe123
  Problem with logging in on website - python w/ requests GoldeNx 6 5,346 Sep-25-2020, 10:52 AM
Last Post: snippsat
  How to perform a successful login(signin) through Requests in Python Kalet 1 2,356 Apr-24-2020, 01:44 AM
Last Post: Larz60+
  Scraping problems with Python requests. gtlhbkkj 1 1,886 Jan-22-2020, 11:00 AM
Last Post: gtlhbkkj
  requests problem abdlwafitahiri 1 1,724 Dec-26-2019, 12:18 PM
Last Post: buran
  "I'm Feeling Lucky" script problem (again) tab_lo_lo 7 7,854 Jul-23-2019, 11:26 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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