上一页 1 ··· 7 8 9 10 11 12 13 下一页
  2021年8月10日
摘要: # pip install opencv-python 先安装cv2库# 读取背景图片和缺口图片bg_img = cv2.imread('bg.jpg') # 背景图片tp_img = cv2.imread('tp.png') # 缺口图片# 识别图片边缘bg_edge = cv2.Canny(bg 阅读全文
posted @ 2021-08-10 22:41 CJTARRR 阅读(863) 评论(0) 推荐(0) 编辑
摘要: # 先获取标签,这里得到的是列表elements = await page.Jx('xpath')# 方法一:for item in elements: src = await (await item.getProperty('src')).jsonValue()​# 方法二:for item in 阅读全文
posted @ 2021-08-10 22:38 CJTARRR 阅读(795) 评论(0) 推荐(0) 编辑
摘要: # 设置request拦截器await page.setRequestInterception(True)page.on('request',lambda req: asyncio.ensure_future(intercept_request(req)))# 设置response拦截器page.o 阅读全文
posted @ 2021-08-10 22:37 CJTARRR 阅读(2077) 评论(0) 推荐(0) 编辑
摘要: frame = page.frames # 得到page中所有iframe对象的列表iframe = frame[0]# 如果iframe内还有iframe,则使用childFrames取出子iframe列表childiframes = iframe.childFrames# iframe对象可以定 阅读全文
posted @ 2021-08-10 22:36 CJTARRR 阅读(1247) 评论(0) 推荐(0) 编辑
摘要: import tkintertk = tkinter.Tk()width = tk.winfo_screenwidth()height = tk.winfo_screenheight()tk.quit() 阅读全文
posted @ 2021-08-10 22:35 CJTARRR 阅读(2795) 评论(0) 推荐(0) 编辑
摘要: from pyppeteer import launcherlauncher.DEFAULT_ARGS.remove("--enable-automation")​from pyppeteer_stealth import stealthfrom pyppeteer import launch# p 阅读全文
posted @ 2021-08-10 22:34 CJTARRR 阅读(199) 评论(0) 推荐(0) 编辑
  2021年7月29日
摘要: 1、先定位到伪类元素节点 利用xpath、css_selector都可以,只要定位到元素所在的节点就行 2、执行js代码获取content content = bro.execute_script("return window.getComputedStyle(arguments[0], '::be 阅读全文
posted @ 2021-07-29 17:51 CJTARRR 阅读(441) 评论(0) 推荐(0) 编辑
  2021年7月24日
摘要: from selenium import webdriverfrom selenium.webdriver import ActionChainsbro = webdriver.Chrome()# 生成action对象action = ActionChains(bro)# 找到要操作的元素eleme 阅读全文
posted @ 2021-07-24 16:13 CJTARRR 阅读(234) 评论(0) 推荐(0) 编辑
  2021年7月23日
摘要: 1、禁止重定向 REDIRECT_ENABLED = False 2、禁用cookies COOKIE_ENABLED = False 3、禁用referer REFERER_ENABLED = False 阅读全文
posted @ 2021-07-23 19:44 CJTARRR 阅读(99) 评论(0) 推荐(0) 编辑
摘要: import json# 需要设置headers和准备payload数据​# 构建payload_headerspayload_headers = {}payload_headers['origin'] = 'https://xxxx.com'payload_headers[ 'user-agent 阅读全文
posted @ 2021-07-23 19:02 CJTARRR 阅读(112) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 下一页