@randymp

implicitly_wait

updated May 10, 2022 · Python
from selenium import webdriver
from selenium.webdriver.common.by import By


#wd =webdriver.Chrome(service=Service(r'C:\chromedriver\chromedriver.exe'))
wd = webdriver.Chrome()
#Selenium 的 Webdriver 对象 有个方法叫 implicitly_wait ,可以称之为 隐式等待 ,或者 全局等待 。
#该方法接受一个参数, 用来指定 最大等待时长。
wd.implicitly_wait(10)

wd.get('https://www.byhy.net/_files/stock1.html')

爬umeitu.com/bizhitupian/weimeibizhi/

updated April 27, 2022 · Python
import requests
from bs4 import BeautifulSoup

domain = 'https://www.umeitu.com/bizhitupian/'

req =requests.get(url=domain)
req.encoding = "utf-8"
# print(req.text)
main_page =BeautifulSoup(req.text, "html.parser")
# print(main_page)
uli =main_page.find("ul", attrs={"class":"pic-list after"}).find_all("img")

bs4_request(项目)

updated April 27, 2022 · Python
import requests
from bs4 import BeautifulSoup
import csv

url = 'https://www.cnhnb.com/hangqing/q-2003192-0-0-45081/'
head = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
}
req =requests.get(url=url,headers=head)
print(req)
220.181.108.75~220.181.108.123(百度蜘蛛电信段IP)

123.125.71.12~123.125.71.117(百度蜘蛛联通段IP)

220.181.107.*

220.181.38.177

220.181.19.*

159.226.50.*

toán tử python

updated January 15, 2022 · Python
'''các loại toán tử

1.Toán tử số học
+       phép cộng       12+4.9 ;kết quả 16.9
-       phép trừ        3.98-4 ;kết quả -0.02
*       phép nhân       2*3.4  ;kết quả 6.8 
/       phép chia       9/2    ;kết quả 4.5
//      chia lấy nguyên 9//2   ;kết quả 4
%       chia lấy dư     9/2    ;kết quả 1
**      lũy thừa        3**4   ;kết quả 81