from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.set_window_size(1000,1000) #控制視窗大小
driver.get('https://comicbus.live/online/manga_9199.html?ch=8005')
- May 06 Wed 2020 12:08
-
py-crawler selenium配合下載漫畫
- Apr 25 Sat 2020 18:31
-
py-ml linear-model
import numpy as np
from sklearn.linear_model import LinearRegression
import matplotlib.pyplot as plt
- Feb 13 Thu 2020 17:19
-
py-autogui confidence與常使用語法
pip install opencv--python
##可使用 confidence來解決圖像誤差
sure =pyautogui.locateOnScreen("back.png",confidence=0.95)
while True:
print("尋找背景")
- Feb 10 Mon 2020 18:59
-
py-autogui 鍵盤操作
- Feb 10 Mon 2020 18:11
-
py-autogui 簡單實作搜圖並移動鼠標點選
- Feb 10 Mon 2020 17:42
-
py-autogui 基本滑鼠移動and座標
- Jan 12 Sun 2020 15:08
-
py-crawler PTT爬取joke板
import requests
from bs4 import BeautifulSoup
res=requests.get('https://www.ptt.cc/bbs/joke/index.html')
soup=BeautifulSoup(res.text,'lxml')
- Jan 12 Sun 2020 14:51
-
py-crawler 模擬用戶代理user agent
requests.get之後 若遇到目前無法找到頁面
F12>Documents >Headers>Requests Headers送請求時的表投 >User-Agent #偽裝代理服務
import requests
head={'User-Agent' : 'xxxxxxx'}
res=requests.get(url,headers=head)
- Jan 10 Fri 2020 19:42
-
py-crawler requests & BeautifulSoup4
import requests
res=requests.get("url",verify=False) #遇到SSLError 可以用verify繞過憑證檢查
print(res.text)
from bs4 import BeautifulSoup
soup = BeautifulSoup(res.text, "lxml") #也有html.parser
- Jan 04 Sat 2020 12:16
-
py-crawler Selenium
anaconda安裝用Selenium
主要是因為爬蟲沒辦法直接看到JS的渲染
from selenium import webdriver
driver = webdriver.PhantomJS(executable_path=r'C:\Users\USER\Desktop\phantomjs-2.1.1-windows\phantomjs-2.1.1-windows\bin\phantomjs.exe') # PhantomJs
driver.get('http://pala.tw/js-example/') # 輸入範例網址,交給瀏覽器
- Dec 27 Fri 2019 22:20
-
py-matplotlib顯示兩張圖figure
-------------------------------------------------------------------------------------------------------------------顯示兩張圖figure
x=np.linspace(-1,1,50)座標-1到1間有五十個點
y1=2*x+1
y2=x**2
plt.figure()第一張圖
- Dec 27 Fri 2019 22:18
-
py-matplotlib有標籤的圖
import matplotlib.pyplot as plt
data = pd.DataFrame(np.random.randn(1000, 5), 顯示五行數字columns是ABCDE 5個英文字就要數字5
index=np.arange(1000),
columns=list("ABCDE"))
data=data.cumsum()數據累加
