目的是根据电影名字爬取豆瓣ID 保存格式为文件夹名字 一个电影生产一个文件夹《电影名字,豆瓣ID》
搞了好久都获取不到ID
下面还有一段 一起发说安全问题 发不出来...
[ol]import requests
from bs4 import BeautifulSoup
import os
import re
import time
# 搜索链接
search_url = "https://search.douban.com/movie/subject_search?search_text={}&cat=1002"
movies = [
"毒舌律师",
"满江红",
"倒数说爱你",
"别叫我“赌神”",
"银河护卫队3",
"温柔壳",
"盟约",
"检察风云",
"消失的她",
"蚁人与黄蜂女:量子狂潮",
"惊声尖叫6",
"荒原",
"无名",
"望道",
"龙与地下城:侠盗荣耀",
"小行星城",
"交涉",
"疾速追杀4",
"茶啊二中",
"中国乒乓之绝地反击",
"再见,我的灵魂伴侣",
"这么多年",
"星条红与皇室蓝",
"网络谜踪2",
"蜘蛛侠:纵横宇宙",
"变形金刚:超能勇士崛起",
"小美人鱼",
"我爱你!",
"长沙夜生活",
"人生路不熟"
]
[/ol]复制代码