当前位置: 首页 > news >正文

网站app的作用进一步加强网站建设管理

网站app的作用,进一步加强网站建设管理,手机制作网页的步骤,网站开发哪家公司口碑好主要内容#xff1a;模拟bilibili账号密码登录#xff0c;不要实现的的实现功能是单击登录按钮#xff0c;切换登录方式#xff0c; 输入账号和密码#xff0c;然后完成图片点击验证#xff0c;最后单击立即登录按钮。 1、第一步#xff1a;通过selenium模块访问bilibi…        主要内容模拟bilibili账号密码登录不要实现的的实现功能是单击登录按钮切换登录方式 输入账号和密码然后完成图片点击验证最后单击立即登录按钮。 1、第一步通过selenium模块访问bilibili的登录页面定位并单击账号登陆按钮然后分别定位账号和密码输入框并输入账号和密码。 2、第二步识别图片中图形的位置。 3、第三步进行按照图形识别顺序进行点击。 4、第四步点击确认标签。 ############################## ##作者白雪公主的后妈 ##时间2024年1月12日 ##主题Python爬虫进阶——案例模拟bilibili登录 ##主要内容模拟bilibili登录 ##############################模拟bilibili账号密码登录不要实现的的实现功能是单击登录按钮切换登录方式 输入账号和密码然后完成图片点击验证最后单击立即登录按钮#第一步通过selenium模块访问bilibili的登录页面定位并单击账号登陆按钮然后分别定位账号和密码输入框并输入账号和密码。 from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By import time ################################# import base64 import json import requests import pandas as pd ################################# # from PIL import Image service Service(E:\\python\\Scripts\\chromedriver.exe) #实例化一个谷歌浏览器 browser webdriver.Chrome(serviceservice) browser.get(https://www.bilibili.com/) #访问bilibili的登录页面 #访问淘宝网页首页login_user_page browser.find_element(By.XPATH,//*[idi_cecream]/div[2]/div[1]/div[1]/ul[2]/li[1]/li/div/div/span) #通过XPath表达式定位账号登陆按钮 login_user_page.click() #单击账号登录按钮 time.sleep(2) username_input browser.find_element(By.XPATH,//*[classlogin-pwd-wp]/form/div[1]/input) #通过标点ID定位账号输入框 password_input browser.find_element(By.XPATH,//*[classlogin-pwd-wp]/form/div[3]/input) #通过标点ID定位密码输入框 username_input.send_keys(123456) #在账号框中输入123456 time.sleep(2) #停留两秒模拟真是人类操作 password_input.send_keys(234567) #在密码框中输入234567 login_button browser.find_element(By.XPATH,//*[classbtn_primary ]) #通过XPath表达式定位登陆按钮 login_button.click() #单击账号登录按钮 time.sleep(2)#第二步识别图片中图形的位置 ############################# def base64_api(uname, pwd, img):验证码识别函数:param uname: 快识别用户名:param pwd: 快识别密码:param img: 图片路径:return: 返回坐标点with open(img, rb) as f:base64_data base64.b64encode(f.read())b64 base64_data.decode()data {username: uname, password: pwd, typeid: 21, image: b64}result json.loads(requests.post(http://api.ttshitu.com/predict, jsondata).text)if result[success]:return result[data][result]else:# 注意返回 人工不足等 错误情况 请加逻辑处理防止脚本卡死 继续重新 识别return result[message] ############################## 解决验证码自动识别问题 Img_input browser.find_element(By.XPATH,//*[classgeetest_holder geetest_silver]) Img_input.screenshot(yzm.png)#对图片进行解码获取验证码识别以后的结果 result base64_api(XXXX,XXXX,yzm.png) # print(验证码识别结果,result) #结果33,254|232,70|214,133|90,236 result_list result.split(|) print(result_list)#第三步进行按照图形识别顺序进行点击 借助selenium执行点击操作 for i in result_list:x result_list.split(,)[0] #构建x,y轴坐标y result_list.split(,)[1]#ActionChains为动作链对象指定标签元素进行点击Img_input, int(x), int(y)click()点击操作perform()执行动作链ActionChains(browser).move_to_element_with_offset(Img_input, int(x), int(y)).click().perform() time.sleep(2)#第四步点击确认标签 OK_button browser.find_element(By.XPATH, //*[classgeetest_commit_tip]) OK_button.click() time.sleep(4) browser.quit() #关闭所有页面退出浏览器驱动程序
文章转载自:
http://www.morning.nfbxgtj.com.gov.cn.nfbxgtj.com
http://www.morning.ktqtf.cn.gov.cn.ktqtf.cn
http://www.morning.bpmz.cn.gov.cn.bpmz.cn
http://www.morning.qbjrl.cn.gov.cn.qbjrl.cn
http://www.morning.plxnn.cn.gov.cn.plxnn.cn
http://www.morning.zqkr.cn.gov.cn.zqkr.cn
http://www.morning.yunease.com.gov.cn.yunease.com
http://www.morning.gmwdl.cn.gov.cn.gmwdl.cn
http://www.morning.pccqr.cn.gov.cn.pccqr.cn
http://www.morning.fyglg.cn.gov.cn.fyglg.cn
http://www.morning.gbybx.cn.gov.cn.gbybx.cn
http://www.morning.rkxk.cn.gov.cn.rkxk.cn
http://www.morning.nwllb.cn.gov.cn.nwllb.cn
http://www.morning.wztlr.cn.gov.cn.wztlr.cn
http://www.morning.cjmmt.cn.gov.cn.cjmmt.cn
http://www.morning.mglqf.cn.gov.cn.mglqf.cn
http://www.morning.qlrwf.cn.gov.cn.qlrwf.cn
http://www.morning.ydxg.cn.gov.cn.ydxg.cn
http://www.morning.jtwck.cn.gov.cn.jtwck.cn
http://www.morning.rxfjg.cn.gov.cn.rxfjg.cn
http://www.morning.ntffl.cn.gov.cn.ntffl.cn
http://www.morning.yfmxn.cn.gov.cn.yfmxn.cn
http://www.morning.hrjrt.cn.gov.cn.hrjrt.cn
http://www.morning.ndmh.cn.gov.cn.ndmh.cn
http://www.morning.nnykz.cn.gov.cn.nnykz.cn
http://www.morning.mnsmb.cn.gov.cn.mnsmb.cn
http://www.morning.mfct.cn.gov.cn.mfct.cn
http://www.morning.rqnzh.cn.gov.cn.rqnzh.cn
http://www.morning.xtdtt.cn.gov.cn.xtdtt.cn
http://www.morning.pndw.cn.gov.cn.pndw.cn
http://www.morning.srgbr.cn.gov.cn.srgbr.cn
http://www.morning.sgbsr.cn.gov.cn.sgbsr.cn
http://www.morning.xesrd.com.gov.cn.xesrd.com
http://www.morning.qhtlq.cn.gov.cn.qhtlq.cn
http://www.morning.bnygf.cn.gov.cn.bnygf.cn
http://www.morning.hgfxg.cn.gov.cn.hgfxg.cn
http://www.morning.dthyq.cn.gov.cn.dthyq.cn
http://www.morning.zrpys.cn.gov.cn.zrpys.cn
http://www.morning.kycwt.cn.gov.cn.kycwt.cn
http://www.morning.qzmnr.cn.gov.cn.qzmnr.cn
http://www.morning.dztp.cn.gov.cn.dztp.cn
http://www.morning.mrfbp.cn.gov.cn.mrfbp.cn
http://www.morning.tsgxz.cn.gov.cn.tsgxz.cn
http://www.morning.lkbkd.cn.gov.cn.lkbkd.cn
http://www.morning.kjcll.cn.gov.cn.kjcll.cn
http://www.morning.mmqhq.cn.gov.cn.mmqhq.cn
http://www.morning.sooong.com.gov.cn.sooong.com
http://www.morning.qcwrm.cn.gov.cn.qcwrm.cn
http://www.morning.yxdrf.cn.gov.cn.yxdrf.cn
http://www.morning.pclgj.cn.gov.cn.pclgj.cn
http://www.morning.rgxcd.cn.gov.cn.rgxcd.cn
http://www.morning.gbjxj.cn.gov.cn.gbjxj.cn
http://www.morning.zpfqh.cn.gov.cn.zpfqh.cn
http://www.morning.bfrsr.cn.gov.cn.bfrsr.cn
http://www.morning.rykn.cn.gov.cn.rykn.cn
http://www.morning.dpsgq.cn.gov.cn.dpsgq.cn
http://www.morning.hwycs.cn.gov.cn.hwycs.cn
http://www.morning.zdsdn.cn.gov.cn.zdsdn.cn
http://www.morning.mnlk.cn.gov.cn.mnlk.cn
http://www.morning.lwyqd.cn.gov.cn.lwyqd.cn
http://www.morning.jzgxp.cn.gov.cn.jzgxp.cn
http://www.morning.mcqhb.cn.gov.cn.mcqhb.cn
http://www.morning.csnch.cn.gov.cn.csnch.cn
http://www.morning.rnygs.cn.gov.cn.rnygs.cn
http://www.morning.hhqjf.cn.gov.cn.hhqjf.cn
http://www.morning.rdkqt.cn.gov.cn.rdkqt.cn
http://www.morning.kdjtt.cn.gov.cn.kdjtt.cn
http://www.morning.chmkt.cn.gov.cn.chmkt.cn
http://www.morning.nzqqd.cn.gov.cn.nzqqd.cn
http://www.morning.xfjwm.cn.gov.cn.xfjwm.cn
http://www.morning.rqlf.cn.gov.cn.rqlf.cn
http://www.morning.lsjgh.cn.gov.cn.lsjgh.cn
http://www.morning.grpfj.cn.gov.cn.grpfj.cn
http://www.morning.nfzw.cn.gov.cn.nfzw.cn
http://www.morning.ysbhj.cn.gov.cn.ysbhj.cn
http://www.morning.ldsgm.cn.gov.cn.ldsgm.cn
http://www.morning.kyytt.cn.gov.cn.kyytt.cn
http://www.morning.cywf.cn.gov.cn.cywf.cn
http://www.morning.gmyhq.cn.gov.cn.gmyhq.cn
http://www.morning.gcfrt.cn.gov.cn.gcfrt.cn
http://www.tj-hxxt.cn/news/270980.html

相关文章:

  • 企业网站建设数据现状分析龙华线上推广
  • 北海教网站建设做阿里巴巴网站找谁
  • 制作付款网站餐饮运营策划公司
  • 做民宿的网站路由器优化大师
  • 国外有哪些做建筑材料的网站dw和sql做网站
  • 郑州好的企业网站建设如何登录网站服务器
  • 章丘网站开发培训英铭网站建设
  • 杭州外贸建站网站建设与维护大作业
  • 郑州外贸营销网站建设施工企业质量月活动总结报告
  • 手机网站制作移动高端网站建设世界经理人网站手机版
  • storyset自定义插画网站线上怎么做推广和宣传
  • 自助建站空间怎么用国内外做gif的网站
  • 盐城市城南新区建设局网站论文答辩ppt模板免费下载 素材
  • 学校网站资源建设方案怎么开一个做网站的工作室
  • 旅游网站建设 策划书东莞响应式网站哪家强
  • 重庆技术网站建设网站301在哪里做
  • 做类似淘宝的网站设计需要什么网站的企业风采怎么做
  • 网站后台素材台州网站建设团队
  • 嘉定企业网站制作休闲食品网站建设策划书
  • 网站内外链接怎么做设计iphone手机网站
  • 一般纳税人网站建设多少税率po wordpress
  • 环保类网站建设网站建设哪家信誉好
  • 国内单页网站宁波全网营销型网站建设
  • wordpress 网站改名手机网页版微信下载
  • ps平面设计主要做什么网站标题优化
  • 手表网站app推荐信阳网站开发公司
  • 益阳网站建设公司有哪些投资1元赚1000
  • 网站建设酷隆静态网站站内搜索
  • 做网站的必要百度引流怎么推广
  • 做网站和网站页面设计seopc流量排名网站