简体   繁体   English

网站未使用JSoup获取所有POST数据

[英]Website not taking all POST Data using JSoup

I'm trying to login into a website and try to map data to see if the English to French translations are right, but for some reason, the only data it's taking is the username and password, and ignoring all language-related data. 我正在尝试登录一个网站并尝试映射数据以查看英语到法语的翻译是否正确,但是由于某种原因,它所使用的唯一数据是用户名和密码,而忽略了所有与语言相关的数据。

This is what I tried: 这是我尝试的:

Connection.Response res = Jsoup.connect(URL)
        .data("timezoneOffset", timeZoneOffset)
        .data("ptmode", ptMode)
        .data("ptlangcd", ptLangCD)
        .data("ptinstalledlang", ptInstalledLang)
        .data("userid", userID)
        .data("pwd", pwd)
        .data("ptlangsel", ptLangSel)
        .header("Host", HOST).userAgent(USER_AGENT)
        .header("Accept", ACCEPT)
        .header("Accept-Language", ACCEPT_LANGUAGE)
        .header("Accept-Encoding", ACCEPT_ENCODING)
        .referrer(REFERER)
        .method(Connection.Method.POST)
        .execute();

Document document = res.parse();
System.out.println(document);

The first line of the HTML should return: HTML的第一行应返回:

<html dir="ltr" lang="fr-ca" class='firefox win pc standard'>

but instead it returns: 但是它返回:

<html dir="ltr" lang="en" class="firefox win pc standard">

I would really appreciate any suggestions, even hints in the right direction. 我真的很感激任何建议,甚至可以向正确的方向暗示。

Thanks! 谢谢!

Fire your favorite browser and open the Network tab in the developper toolbar. 触发您喜欢的浏览器,然后在开发人员工具栏中打开“网络”标签。

Inspect the headers exchanged between your browser and the server. 检查浏览器和服务器之间交换的标头。

Once done, do the same in your code. 完成后,在代码中执行相同的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM