摘要:
#!/usr/bin/env python #coding: utf8 #python2 from bs4 import BeautifulSoup ''' 标签查找与属性查找: 标签: - 字符串过滤器 字符串全局匹配 name 属性匹配 attrs 属性查找匹配 text 文本匹配 ... 阅读全文
摘要:
#!/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... 阅读全文
摘要:
#!/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... 阅读全文
摘要:
''' 终极版 ''' def get_good(driver): line = 1 try: time.sleep(12) #下拉滑动5000px js_code = ''' window.scrollTo(0,5000) ''' driver.execute_script... 阅读全文
摘要:
''' 初级版 ''' driver = webdriver.Chrome(r'C:\Users\Administrator\Desktop\chromedriver.exe') try: driver.implicitly_wait(10) driver.get('https://jd.com/') #往京东输入框输入墨菲定律,按回车键 input_tag =... 阅读全文
摘要:
#!/usr/bin/env python #coding: utf8 #python2 #执行js代码 from selenium import webdriver from selenium.webdriver import ActionChains # 破解滑动验证码的时候用的 可以拖动图片 阅读全文
摘要:
#!/usr/bin/env python #coding: utf8 #python2 #Actions chains #动作链对象,需要把driver驱动传给他 #动作链对象可以操作一系列设定好的行为 #滑块移动 from selenium import webdriver from selenium.webdriver import ActionChains # 破解滑动验证码的时候用的... 阅读全文
摘要:
#!/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... 阅读全文