摘要:
#encoding: utf-8 import re # 1. 匹配某个字符串: #re.match 尝试从字符串的起始位置匹配一个模式, # 如果不是起始位置匹配成功的话,match()就返回none。 # text = "hello" # ret = re.match('he',text) # print(ret.group()) # 2. 点:匹配除了换行符以外的任意的字符,匹配换行... 阅读全文
摘要:
def foo(*args,**kwargs): ''' 函数定义时接收不定常参数 :param args: :param kwargs: :return: ''' pass def foo_01(x,y,z,a,b): ''' 参数传递 :param x: :param y: :param z: ... 阅读全文
摘要:
#浏览器一直转圈,无法爬取,解决办法 browser.set_page_load_timeout(10) try: browser.get('https://yq.aliyun.com/articles/490268?tdsourcetag=s_pcqq_aiomsg') except TimeoutError: print('time out after 30 seconds ... 阅读全文
摘要:
#切换到新窗口 import time from selenium import webdriver from selenium.webdriver.firefox.options import Options as FOptions options=FOptions() browser=webdriver.Firefox(executable_path="/Users/mac126/g... 阅读全文
摘要:
#动作链进阶 import time from selenium import webdriver from selenium.webdriver.firefox.options import Options as FOptions options=FOptions() browser=webdriver.Firefox(executable_path="/Users/mac126/ge... 阅读全文
摘要:
#鼠标模拟悬停并点击 import time from selenium import webdriver from selenium.webdriver.firefox.options import Options as FOptions options=FOptions() browser=webdriver.Firefox(executable_path="/Users/mac12... 阅读全文
摘要:
import time from selenium import webdriver from selenium.webdriver.firefox.options import Options as FOptions options=FOptions() browser=webdriver.Firefox(executable_path="/Users/mac126/geckodrive... 阅读全文