随笔分类 - selenium
摘要:改源码 requestium.py if isinstance(self.webdriver_options['prefs'], dict): download_dir = self.webdriver_options['prefs'].get('download.default_directory
阅读全文
摘要:0.安装selenium + Chrome Driver安装selenium:pip install selenium安装Chrome Driver: 下载:http://chromedriver.storage.googleapis.com/index.html版本要对应(chrome://ver
阅读全文
摘要:import sys import requests from requestium import Session, Keys import json import pandas as pd import time import pickle import os import datetime im
阅读全文
摘要:firstly, get cookie: browser.get_cookies()then transfer to requests session: cookies = login() for cookie in cookies: session.cookies.set(cookie['name
阅读全文
摘要:from selenium import webdriver from selenium.webdriver.common.by import By import time option = webdriver.ChromeOptions() option.add_experimental_opti
阅读全文
摘要:import requestsimport seleniumfrom selenium import webdriverfrom selenium.webdriver.common.by import By option = webdriver.ChromeOptions()option.add_e
阅读全文
摘要:查看chrome安装目录:C:\Users\***\AppData\Local\Google\Chrome\Application 命令行进入安装目录执行:chrome.exe --remote-debugging-port=9180 --user-data-dir="D:\selenum_temp
阅读全文
摘要:合体.
阅读全文
摘要:碰到这个问题,没法解决, 最后这么搞的
阅读全文
摘要:firefox和chrome都可以设置无界面模式。 我一般在调试脚步的时候,可以使用有界面的模式,这样可以看到元素定位的步骤。有时候用chrome打开项目时,需要定位的元素是排在li[0]的位置,但是selenium调用chrome打开,该元素排序就出现变化,至今未明白;所以只能在调试的时候,用有界
阅读全文
摘要:python+selenium+Chromedriver使用location定位元素坐标偏差使用xpath定位元素,用.location获取坐标值,截取网页截图的一部分出现偏差。 之所以会出现这个坐标偏差是因为windows系统下电脑设置的显示缩放比例造成的,location获取的坐标是按显示100
阅读全文
摘要:需要注意的是,每次移动都是在上一次坐标的基础上(即坐标值是累积的),如上的代码实际运行时,点击完左键再点击右键,坐标会变成(400, 200)。 可以用封装来抵消这种累积(点击完之后将鼠标坐标恢复),代码如下:
阅读全文
摘要:前因后果之哗啦啦废话连篇: 这几天本人在 Python 做某网站登陆的时候,发现其登陆时用户名和密码被加密了 F12 仔细看了一下,发现是调用了一个 js 的 rsa 加密库,页面 dom 中有 rsa 公钥 于是乎,用了 3 分钟刷刷的潇洒的写了个 py 脚本,结果对比后傻眼了。。。 web 页面
阅读全文
摘要:配置好webdriver,用的是Chrome的
阅读全文
摘要:首先,HTTP是建立在TCP协议基础上的,而WebSocket通常也是建立在TCP上,所以说为什么有些网页游戏抓不到包而有些又可以,这仅是因为你使用的抓包工具是针对了HTTP的通信协议。 我先从抽象的层面,举一个可能不太恰当的例子,只为了让不明白HTTP和WebSocket两者之间抓包有何区别的同学
阅读全文
摘要:遍历JavaScript某个对象所有的属性名称和值的方法,这样想使用方法的时候非常的直观和方便。整理成了一个函数 来自阿江 整理了几个javascript参考文档 当需要用的时候发现一个也找不出来了,费了不少工夫找到了这些,已制作为chm文件: 1、javascript 参考 V1.5(英文) ht
阅读全文
摘要:https://blog.csdn.net/xiaoguanyusb/article/details/80324210 由借鉴意义, 转过来 canvas 是一个画布,定位元素时只能定位到画布上,如下乳所示,网页上有一张类似于下图的eChart报表图片。selenium的基本定位方式只能定位到该画布
阅读全文
摘要:https://stackoverflow.com/questions/43609429/how-to-get-text-inside-a-canvas-using-webdriver-or-protractor https://sqa.stackexchange.com/questions/325
阅读全文
摘要:from: https://www.linkedin.com/pulse/html-canvas-testing-selenium-opencv-maciej-kusz Since HTML <canvas> become more and more popular for creating int
阅读全文
摘要:https://stackoverflow.com/questions/923885/capture-html-canvas-as-gif-jpg-png-pdf https://stackoverflow.com/questions/19395649/python-pil-create-and-s
阅读全文