【PYTHON】利用Python爬取电影网站
利用Python爬取电影网站 #!/usr/bin/env python #coding = utf-8 ''' 本爬虫是用来爬取6V电影网站上的电影资源的一个小脚本程序,爬取到的电影链接会通过网页的形式显示出来 ''' import requests import re from bs4 import BeautifulSoup as bs from queue import Queue from other import getUser_Agent import threading import sys import time headers = getUser_Agent.getUser_Agent() class Movielinks(threading.Thread): def __init__(self,que,filepath,totalcount,starttime): threading.Thread.__init__(self) self._que = que self._filepath = filepath self._totalcount = totalcount self._starttime = starttime def run(self): try: while not self._que.empty(): url = self._que.get(