摘要:
'''''' ''' 爬取豌豆荚app数据 - 请求url page2: https://www.wandoujia.com/wdjweb/api/category/more?catId=6001&subCatId=0&page=2&ctoken=vbw9lj1sRQsRddx0hD-XqCNF ''' import requests from bs4 import BeautifulSoup... 阅读全文
摘要:
from bs4 import BeautifulSoup import requests #请求url https://www.wandoujia.com/category/6001 #请求方式: get def have_title(tag): if tag.name == 'span' and tag.has_attr("title"): return tag ... 阅读全文
摘要:
'''''' ''' find: 找第一个 find_all: 找所有 标签查找与属性查找: name 属性匹配 name 标签名 attrs 属性查找匹配 text 文本匹配 标签: - 字符串过滤器 字符串全局匹配 - 正则过滤器 re模块匹配 - ... 阅读全文
摘要:
html_doc = """ The Dormouse's story $37 Once upon a time there were three little sisters; and their names were Elsie, Lacie and Tillie; and they lived at the bottom of a well. ... """ from bs4 impo... 阅读全文
摘要:
'''''' ''' 模拟浏览器的前进后退 ''' import time from selenium import webdriver browser = webdriver.Chrome() browser.get('https://www.baidu.com') browser.get('https://www.taobao.com') browser.get('http://www... 阅读全文
摘要:
'''''' ''' 点击、清除 ''' # from selenium import webdriver # from selenium.webdriver import ActionChains # from selenium.webdriver.common.keys import Keys # 键盘按键操作 # import time # # # # driver = webdrive... 阅读全文
摘要:
import time from selenium.webdriver.common.keys import Keys from selenium import webdriver driver = webdriver.Chrome(r'D:\Python\Scripts\chromedriver.exe') try: driver.implicitly_wait(10) #... 阅读全文
摘要:
'''''' from selenium import webdriver # web驱动 from selenium.webdriver.common.keys import Keys # 键盘按键操作 import time import time driver = webdriver.Chrome() try: # 隐式等待: 需要在get之前调用 # 等待任意... 阅读全文
摘要:
from selenium import webdriver # web驱动 from selenium.webdriver.common.by import By # 按照什么方式查找,By.ID,By.CSS_SELECTOR from selenium.webdriver.common.keys import Keys # 键盘按键操作 from selenium.webdriver... 阅读全文
摘要:
''' POST请求自动登录github: 请求URL: http://github.com/session 请求方式: post 请求头: cookie user-agent 请求体: commit:Sign in utf8:✓... 阅读全文