栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

使用请求登录到有问题的站点

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用请求登录到有问题的站点

import requestsfrom bs4 import BeautifulSoupwith requests.Session() as req:    r = req.get(        "https://jobs.allianz.com/sap/hcmx/validate_ea?sap-client=100&sap-language={2}", auth=requests.auth.HTTPBasicAuth("SIMMTH.iqbal_123", "SShift_123"))    r = req.get(        "https://jobs.allianz.com/sap/opu/odata/hcmx/erc_ui_auth_srv/UserSet('me')?sap-client=100&sap-language=en")    soup = BeautifulSoup(r.content, 'lxml')    print(soup.prettify())

输出:

<?xml version="1.0" encoding="utf-8"?><html> <body>  <entry xml:base="https://jobs.allianz.com/sap/opu/odata/hcmx/erc_ui_auth_srv/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">   <id>    https://jobs.allianz.com/sap/opu/odata/hcmx/erc_ui_auth_srv/UserSet('SIMMTH.IQBAL_123')    </id>   <title type="text">    UserSet('SIMMTH.IQBAL_123')   </title>   <updated>    2020-03-23T17:16:38Z   </updated>   <category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" term="erc_ui_auth_srv.User">   </category>   <link href="UserSet('SIMMTH.IQBAL_123')" rel="edit" title="User"/>   <link href="UserSet('SIMMTH.IQBAL_123')/DecimalFormat" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DecimalFormat" title="DecimalFormat" type="application/atom+xml;type=entry"/>   <link href="UserSet('SIMMTH.IQBAL_123')/DateFormat" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DateFormat" title="DateFormat" type="application/atom+xml;type=entry"/>   <link href="UserSet('SIMMTH.IQBAL_123')/Language" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Language" title="Language" type="application/atom+xml;type=entry"/>   <link href="UserSet('SIMMTH.IQBAL_123')/$links/DecimalFormat" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/DecimalFormat" title="DecimalFormat" type="application/xml"/>   <link href="UserSet('SIMMTH.IQBAL_123')/$links/DateFormat" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/DateFormat" title="DateFormat" type="application/xml"/>   <link href="UserSet('SIMMTH.IQBAL_123')/$links/Language" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/relatedlinks/Language" title="Language" type="application/xml"/>    <content type="application/xml">    <m:properties>     <d:email>      mthupwork@gmail.com     </d:email>     <d:firstname>      shahin     </d:firstname>     <d:lastname>      iqbal     </d:lastname>     <d:newpassword>     </d:newpassword>     <d:oldpassword>     </d:oldpassword>     <d:logonname>      SIMMTH.IQBAL_123     </d:logonname>     <d:userid>      SIMMTH.IQBAL_123     </d:userid>    </m:properties>   </content>  </entry> </body></html>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/611398.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号