摘要: #!/usr/bin/env python #coding: utf8 #python2 from bs4 import BeautifulSoup ''' 标签查找与属性查找: 标签: - 字符串过滤器 字符串全局匹配 name 属性匹配 attrs 属性查找匹配 text 文本匹配 ... 阅读全文
posted @ 2019-07-03 18:49 立早声几又香 阅读(115) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python #coding: utf8 #python2 #Beautiful选择器 from bs4 import BeautifulSoup html_doc = """ The Dormouse's story $37 Once upon a time there were three little sisters; and their names we... 阅读全文
posted @ 2019-07-03 18:41 立早声几又香 阅读(110) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python #coding: utf8 #python2 #BeautifulSoup4 解析库的使用 from bs4 import BeautifulSoup html_doc = """ The Dormouse's story $37 Once upon a time there were three little sisters; and thei... 阅读全文
posted @ 2019-07-03 18:40 立早声几又香 阅读(93) 评论(0) 推荐(0) 编辑
摘要: ''' 终极版 ''' def get_good(driver): line = 1 try: time.sleep(12) #下拉滑动5000px js_code = ''' window.scrollTo(0,5000) ''' driver.execute_script... 阅读全文
posted @ 2019-07-03 18:39 立早声几又香 阅读(159) 评论(0) 推荐(0) 编辑
摘要: ''' 初级版 ''' driver = webdriver.Chrome(r'C:\Users\Administrator\Desktop\chromedriver.exe') try: driver.implicitly_wait(10) driver.get('https://jd.com/') #往京东输入框输入墨菲定律,按回车键 input_tag =... 阅读全文
posted @ 2019-07-03 18:38 立早声几又香 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python #coding: utf8 #python2 #执行js代码 from selenium import webdriver from selenium.webdriver import ActionChains # 破解滑动验证码的时候用的 可以拖动图片 阅读全文
posted @ 2019-07-03 18:34 立早声几又香 阅读(213) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python #coding: utf8 #python2 #Actions chains #动作链对象,需要把driver驱动传给他 #动作链对象可以操作一系列设定好的行为 #滑块移动 from selenium import webdriver from selenium.webdriver import ActionChains # 破解滑动验证码的时候用的... 阅读全文
posted @ 2019-07-03 18:33 立早声几又香 阅读(158) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python #coding: utf8 #python2 #selenium 剩余部分 #元素交互操作: #1.点击、清楚 #2.actions change #3.执行js代码 #4.frame切换 #以下是元素交互操作 from selenium import webdriver from selenium.webdriver import ActionC... 阅读全文
posted @ 2019-07-03 18:32 立早声几又香 阅读(92) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python #coding: utf8 #python2 #selenium选择器 #https://www.cnblogs.com/kermitjam/p/10863922.html(老师博客地址,有详细方法) from selenium import webdriver #web驱动 from selenium.webdriver.common.keys im... 阅读全文
posted @ 2019-07-02 19:32 立早声几又香 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-07-02 19:29 立早声几又香 阅读(276) 评论(0) 推荐(0) 编辑