失败的模拟登录
import requests
import re
import csv
import ftplib
import os
import sys
import datetime
from selenium import webdriver
import time
from selenium.webdriver.chrome.options import Options
import pandas as pd
from bs4 import BeautifulSoup
import numpy as np
import io
url = 'https://www.dianxiaomi.com/lazadaProduct/syncLazadaProduct.json'
cookie_str = r'Hm_lvt_f8001a3f3d9bf5923f780580eb550c0b=1591059808; _ati=1315840203423; dxm_i=NTQyNDAyIWFUMDFOREkwTURJIWFiN2QxOGY0YTg3NmJmNzhmZGM5OWYyM2M4NTUzNWNl; dxm_t=MTU5MTA2NDI4OCFkRDB4TlRreE1EWTBNamc0ITgyMzExMWQ2ZTU3NWEwNDAxMjU1NjY0NDk1OTI4ZmFh; dxm_c=MEFKdFNzem4hWXowd1FVcDBVM042YmchODY2ZjM5YjdkZDExNTIyNWE4N2RjMWUwZmIwZmU5M2Y; dxm_w=ZTc3YTQ5ZjE5MWE5ZTBhYzMzYmIzNjczNjA5MDQ5OGIhZHoxbE56ZGhORGxtTVRreFlUbGxNR0ZqTXpOaVlqTTJOek0yTURrd05EazRZZyEyOTkxYWFkNjYzNWFjMWMxZDFkNzk1NjRjNTAyMGU3NQ; dxm_s=kqLvpepFpjYv4mL5iHqNfQsoplaEJj7fRm_Bdb7lqf4; _dxm_ad_client_id=464BBE627EC39682D837FC5694CECEADC; Hm_lpvt_f8001a3f3d9bf5923f780580eb550c0b=1591083504; JSESSIONID=7669D4ADB1DCA1CFEE5D3B3F0C9CF41B'
headers = {
"Cookie":cookie_str,
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
}
data={
'pageNo': 1,
'pageSize': 100,
'shopId': -1,
'dxmState': 'online',
'searchType': 3,
'sortValue': 0,
'showImageType': 0,
'productSearchType': 1,
'productStatus': 'active',
'advancedTime': 1,
'quantityType': 0,
'uuid': '1c2ba6c5e2fc4c5abf972732ec14b57f',
'uuid':"92e4c670e0a04c4c8382deeeda79432a",
'code':-1,
'msg':'',
'data':'null',
'num':0,
'totalNum':0,
'createDate':1591155799585
}
resp = requests.post(url,
data,
headers=headers)
print(resp .status_code)
resp.text