摘要: 关于Pycharm同步git 查看git config配置,在终端中输入以下命令: git config --list 然后把自己的git账户添加上 git config --global user.name 你的git账户名 git config --global user.email 你注册gi 阅读全文
posted @ 2020-03-16 20:59 djl_djl 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 用scrapy/selenium爬取校花网 校花网http://www.xiaohuar.com/ 美女校花首页http://www.xiaohuar.com/list-1-0.html 第二页:http://www.xiaohuar.com/list-1-1.html 依次类推 步骤: 1、 创建 阅读全文
posted @ 2020-03-16 20:54 djl_djl 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 用scrapy爬取天天美剧 1、 打开终端,进入相应目录下,激活虚拟环境 source activate spider 2、 进入相应目录下(/spider/exec/),创建新的scrapy项目meijutt scrapy startproject meijutt 以下3~6,可在pycharm中 阅读全文
posted @ 2020-03-16 20:51 djl_djl 阅读(292) 评论(0) 推荐(0) 编辑
摘要: selenium控制滚轮滑动,即在受控浏览器中使用js来控制滚轮滑动。 js中scrollIntoView()的用法 注意:driver是:driver = selenium.webdriver.Chrome(executable_path='XXX/chromedriver.exe') 1、移动到 阅读全文
posted @ 2020-03-16 20:45 djl_djl 阅读(6822) 评论(0) 推荐(0) 编辑
摘要: Scrapy shell也称"Scrapy终端",是一个交互终端,使我们可以在未启动spider爬虫的情况下尝试及调试代码。 启动 - linux下:ctr+Alt+T打开终端,激活虚拟环境,然后输入:scrapy shell “url”(例:scrapy shell “http://www.bai 阅读全文
posted @ 2020-03-16 20:41 djl_djl 阅读(746) 评论(0) 推荐(0) 编辑
摘要: scrapy安装(Linux环境)及爬取百度 安装scrapy 1、 在终端中激活虚拟环境;注意: (1) 虚拟环境之前已建立,可以在pycharm中事先建好 (2) 得与虚拟环境文件夹在同一目录下才能找到并激活虚拟环境 命令:source activate {虚拟环境名称} 激活后路径最前面有(虚 阅读全文
posted @ 2020-03-16 20:37 djl_djl 阅读(434) 评论(0) 推荐(0) 编辑
摘要: 使用XPath定位页面元素的方法,可达到与cssselector相似的功效。 原文链接:https://www.cnblogs.com/lei0213/p/7506130.html 一、简介 XPath 是一门在 XML 文档中查找信息的语言。XPath 可用来在 XML 文档中对元素和属性进行遍历 阅读全文
posted @ 2020-03-16 20:31 djl_djl 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 使用selenium控制chrome点击某一按钮时,总是报错:Element is not clickable at point ,使用下面的方法解决,主要用了方法2和方法6. 原文链接:https://www.cnblogs.com/onlyblog/p/10522849.html 错误Eleme 阅读全文
posted @ 2020-03-16 20:22 djl_djl 阅读(1278) 评论(0) 推荐(0) 编辑
摘要: 使用CssSelector来定位页面中的元素,是经常使用的方式,本文列出典型的使用方法。 转载的,原文链接:https://blog.csdn.net/hou_angela/article/details/80519718 1. 根据 标签定位 tagName(定位的是一组,多个元素) e.g:fi 阅读全文
posted @ 2020-03-16 20:17 djl_djl 阅读(1858) 评论(0) 推荐(0) 编辑
摘要: chromedriver安装与配置(ubuntu linux下): 1、 linux切换到root账户 sudo su 2、 搜索chromedriver安装包 aptitude search chromedriver 3、 安装chromedriver aptitude install chrom 阅读全文
posted @ 2020-03-16 19:00 djl_djl 阅读(2658) 评论(0) 推荐(0) 编辑