request-html 登陆百度
import asyncio
from requests_html import HTMLSession
url = 'https://passport.baidu.com/v2/?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F&sms=5'
session = HTMLSession( browser_args=[
'--no-sand',
'--disable-infobars'
'--user-agent=Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36'
],headless=False)
res = session.request(url=url,method='GET')
script = """
() => {
return {
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight,
deviceScaleFactor: window.devicePixelRatio,
}
}
"""
try:
res.html.render(keep_page = True)
async def main():
await res.html.page.waitFor(1000)
await res.html.page.click(' [id = "TANGRAM__PSP_3__footerULoginBtn"]')
await res.html.page.type(' [id="TANGRAM__PSP_3__userName"]','maonanbei')
await res.html.page.type(' [id="TANGRAM__PSP_3__password"]','goudouxi')
await res.html.page.screenshot({'path': 'login.png'})
await res.html.page.waitFor(100000000)
asyncio.get_event_loop().run_until_complete(main())
except Exception as e:
print(e)
finally:
session.close()
request-html 登陆百度的更多相关文章
- 【教程】模拟登陆百度之Java代码版
[背景] 之前已经写了教程,分析模拟登陆百度的逻辑: [教程]手把手教你如何利用工具(IE9的F12)去分析模拟登陆网站(百度首页)的内部逻辑过程 然后又去用不同的语言: Python的: [教程]模 ...
- 使用HttpWebrequest对网站进行模拟操作(附登陆百度demo)
// a[href=#viewSource]"); //查看源代码标签 viewSourceArr.attr("title", "查看源代码"); v ...
- RFS实例登录126邮箱/利用cookie登陆百度
可以直接添加用户关键字,也可以新建资源,将用户关键字添加入资源,然后导入整个资源文件 用户关键字内部实现如下: 打开126邮箱首页: Open Browser Http://mail.126.com ...
- 模拟登陆百度以及Selenium 的基本用法
模拟登陆百度,需要依赖于selenium 模块,调用浏览器,执行python命令 先来说一下这个selenium模块啦...... 本文参考内容来自 Selenium官网 SeleniumPython ...
- php curl 登陆百度贴吧(经历记录)
这两天,因为公司需要,所以研究了一下百度文库的登陆方案.因为账号是购买的,只有一部分cookie值,所以不能通过正常的渠道登陆,所以只有通过curl模拟直接进行后台登陆.那么,问题来了.按照人家说的, ...
- Selenium模拟登陆百度贴吧
Selenium模拟登陆百度贴吧 from selenium import webdriver from time import sleep from selenium.webdriver.commo ...
- 使用python模拟登陆百度
#!/usr/bin/python # -*- coding: utf- -*- """ Function: Used to demostrate how to use ...
- python selenium 模拟登陆百度账号
代码: from selenium import webdriver url = 'https://passport.baidu.com/v2/?login' username = 'your_use ...
- 呵呵呵呵。。。系统还原了,终于可以用IE登陆百度了
原文发布时间为:2009-12-19 -- 来源于本人的百度文章 [由搬家工具导入] 呵呵呵呵。。。今天终于有时间把系统还原了,终于可以用IE登陆百度了
随机推荐
- k8s记录-kube-dns(core-dns)配置(七)
docker search corednsdocker pull xxx 拉取镜像(根据实际情况选择)docker tag xxx coredns/coredns:latestdocker tag c ...
- springboot项目中使用spring-data-Redis对map序列化时报错
错误信息: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String at org.spri ...
- Jacob操作ppt
前几天使用Apache 的POI操作ppt,后来发现转成的图片出现乱码,而且处理了之后,还会有遗留 因此决定换一种处理方式 Jacob 是 JAVA-COM Bridge的缩写,是一个中间件,能够提供 ...
- AutoResetEvent 学生考试,老师阅卷,学生等待考试结果
class Program { static void Main(string[] args) { )); t.Start(); Console.WriteLine("老师等待提交试卷&qu ...
- laravel 配置自动加载多路由文件
在 app\Providers\RouteServiceProvider文件下增加方法&注册: 增加之后就可以在routers下建立api文件夹,在里面添加路由了
- flask,scrapy,django信号
简介 Django.Flask.scrapy都包含了一个“信号分配器”,使得当一些动作在框架的其他地方发生的时候,解耦的应用可以得到提醒. 通俗来讲,就是一些动作发生的时候,信号允许特定的发送者去提醒 ...
- 第07组 Beta冲刺(3/4)
队名:秃头小队 组长博客 作业博客 组长徐俊杰 过去两天完成的任务:学习了很多东西 Github签入记录 接下来的计划:继续学习 还剩下哪些任务:后端部分 燃尽图 遇到的困难:自己太菜了 收获和疑问: ...
- 自动化运维工具之SaltStack简介与安装
1.SaltStack简介 官方网址:http://www.saltstack.com官方文档:http://docs.saltstack.comGitHub:https:github.com/sal ...
- [转帖]helm模板文件chart编写语法详解
helm模板文件chart编写语法详解 https://blog.51cto.com/qujunorz/2421328 需要学习一下. charts编写介绍 开始 快速创建一个chart模板,helm ...
- python-tkinter使用方法——转载(一)
Tkinter图形界面设计(GUI) 转载URL:https://www.cnblogs.com/pywjh/p/9527828.html#lable [因为这是我第一个接触的GUI图形界面py ...