发布消息后网站不重定向

时间:2019-08-10 23:40:03

标签: python python-requests mechanize mechanize-python

我正在尝试通过发布信息搜索德国品牌注册信息,但是在“发布”数据之后,我没有被重定向。

有人知道问题出在哪里吗?

也许是缺少的“ t:formdata”,但是如果我尝试使用原始的“ t:formdata”,则会得到相同的结果

我的代码:

import mechanicalsoup

browser = mechanicalsoup.StatefulBrowser()
browser.set_user_agent(
    'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36')

browser.open('https://register.dpma.de/DPMAregister/marke/einsteiger')

payload = {
    "searchType": "beginnerNew",
    "checkbox": "on",
    "checkbox_0": "on",
    "checkbox_1": "on",
    "marke": "Tula-Toys",
    "rn": "",
    "bwt": "",
    "mf": "",
    "inh": "",
    "kla1": "",
    "kla2": "",
    "kla3": "",
    "wbk": "",
    "wdv": "",
    "tConfigEingeklappt": "false",
    "checkbox_5": "on",
    "checkbox_8": "on",
    "sortierSpalte": "MarkenIdentifikation",
    "select_0": "aufsteigend",
    "trefferProSeite": "100",
    "maxTreffer": "1000",
    "cookieDummy": "",
    "rechercheStarten": "Recherche starten"
}

header = {}

header['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3'
header['Accept-Encoding'] = 'gzip, deflate, br'
header['Accept-Language'] = 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7'
header['content-type'] = 'application/x-www-form-urlencoded'
header['referer'] = 'https://register.dpma.de/DPMAregister/marke/einsteiger'

res = browser.post('https://register.dpma.de/DPMAregister/marke/einsteiger.kopf.form', headers=header,
                   allow_redirects=True)

0 个答案:

没有答案