Commit d043b629 authored by liyang's avatar liyang

fix:爬取数据入库

parent c077ada2
...@@ -60,7 +60,10 @@ def write_to_database(data): ...@@ -60,7 +60,10 @@ def write_to_database(data):
def reptile(browser=None, search_word=""): def reptile(browser=None, search_word=""):
url = "https://www.ptt.cc/bbs/hotboards.html" url = "https://www.ptt.cc/bbs/hotboards.html"
browser = browser or create(['--headless']) # 无头模式执行
# browser = browser or create(['--headless'])
# 有头模式执行
browser = browser or create()
# 打开网页 # 打开网页
browser.get(url) browser.get(url)
log.debug("已打开浏览器") log.debug("已打开浏览器")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment