1. 程式人生 > >根據ebayno爬取可見資訊 本地+資料庫 API

根據ebayno爬取可見資訊 本地+資料庫 API

import random
from http.cookiejar import CookieJar
import requests
from bs4 import BeautifulSoup
import csv
import numpy as np
import re
import xlrd
import os
import json
from queue import Queue
import time
import random
import threading
import logging
import pandas as pd
from my_feedback_ebayno import Feedback_ebayno
from local_data import Database
class EbaySpider(object):
    def __init__(self):
        self.db = Database()
        self.SESSION = requests.session()
        self.SESSION.cookies = CookieJar()
        # print(self.SESSION.cookies)
        self.HEAD = self.randHeader()


    def randHeader(self):
        head_connection = ['Keep-Alive', 'close']
        head_accept = ['text/html, application/xhtml+xml, */*']
        head_accept_language = ['zh-CN,fr-FR;q=0.5', 'en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3']
        head_user_agent = ['Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko',
                           'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; rv:11.0) like Gecko)',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.2) Gecko/2008070208 Firefox/3.0.1',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.1) Gecko/20070309 Firefox/2.0.0.3',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.1) Gecko/20070803 Firefox/1.5.0.12',
                           'Opera/9.27 (Windows NT 5.2; U; zh-cn)',
                           'Mozilla/5.0 (Macintosh; PPC Mac OS X; U; en) Opera 8.0',
                           'Opera/8.0 (Macintosh; PPC Mac OS X; U; en)',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080219 Firefox/2.0.0.12 Navigator/9.0.0.6',
                           'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0)',
                           'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)',
                           'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Maxthon/4.0.6.2000 Chrome/26.0.1410.43 Safari/537.1 ',
                           'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; QQBrowser/7.3.9825.400)',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 ',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.92 Safari/537.1 LBBROWSER',
                           'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; BIDUBrowser 2.x)',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/3.0 Safari/536.11']

        header = {
            'Connection': head_connection[0],
            'Accept': head_accept[0],
            'Accept-Language': head_accept_language[1],
            'User-Agent': head_user_agent[random.randrange(0, len(head_user_agent))]
        }
        return header

    def getBeautifulSoup(self, query_rl):
        r = self.SESSION.get(url=query_rl, headers=self.HEAD)
        # print(self.SESSION.cookies)
        soup = BeautifulSoup(r.text, 'html.parser')
        return soup

    def getRates(self):
        query_rl = "https://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_ipg=100&rt=nc&_nkw=window regulator&_pgn=1&_skc=0"
        r = self.SESSION.get(url=query_rl, headers=self.HEAD)
        # print(self.SESSION.cookies)
        soup = BeautifulSoup(r.text, 'html.parser')
        content = soup.find("span", "rcnt")
        itemSize = int(str(content.string).replace(",",""))
        # print("初次查詢:" + str(itemSize) + "項")
        #獲取第一個ebayno,將收貨地址更改
        itm = soup.find("div", "lvpic pic img left")['iid']
        # print("設定shippingandpayments為美國US")
        getrates_url = "http://www.ebay.com/itm/getrates?item=" + itm + "&country=1&co=0&cb=jQuery1705349737076189762_1501724760425"
        r = self.SESSION.get(url=getrates_url, headers=self.HEAD) #發請求,儲存cookie

    def get_sku(self,ebayno):
        ebayno = str(ebayno)
        if os.path.exists("ebayno//"+ebayno+".xlsx"):
            return
        # if self.db.is_exists_ebayno(ebayno):
        #     return
        # http://developer.ebay.com/devzone/shopping/docs/callref/getsingleitem.html
        # Compatibility 	Description 	Details 	ItemSpecifics 	ShippingCosts 	TextDescription 	Variations
        url = "http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=JSON&" \
              "appid=yourappid&siteid=100&version=967&" \
              "IncludeSelector=Details,Description,ItemSpecifics,Compatibility&" \
              "ItemID=" + ebayno
        r = requests.get(url)
        item = json.loads(r.text)
        sku = item["Item"]["SKU"]
        print(sku)
        title = item["Item"]["Title"]
        desc = item["Item"]["Description"]
        specific = item["Item"]["ItemSpecifics"]
        try:
            fitment = item["Item"]["ItemCompatibilityList"]
        except:
            print(ebayno)
            fitment=""
        result = [[ebayno, sku, title, desc, specific, fitment]]
        df = pd.DataFrame(result,columns=["ebayno","ebay_sku","title","description","specific","fitment"])
        df.to_excel("ebayno//"+ebayno+".xlsx",index=False)
        # self.db.save([ebayno, sku, title, desc, specifc, fitment])  # 儲存到資料庫



class ThreadCrawl(threading.Thread): #ThreadCrawl類繼承了Threading.Thread類

    def __init__(self, queue):  #子類特有屬性, queue
        FORMAT = time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime()) + "[AmazonSpider]-----%(message)s------"
        logging.basicConfig(level=logging.INFO, format=FORMAT)
        threading.Thread.__init__(self)
        self.queue = queue
        self.spider = EbaySpider()  #子類特有屬性spider, 並初始化,將例項用作屬性

    def run(self):
        while True:
            success = True
            item = self.queue.get() #呼叫佇列物件的get()方法從隊頭刪除並返回一個專案item
            self.spider.get_sku(item)  # 呼叫例項spider的方法getDataById(item)
            # try:
            #     self.spider.search(item) #呼叫例項spider的方法getDataById(item)
            # except :
            #     success = False
            # if not success :
            #     self.queue.put(item)
            logging.info("now queue size is: %d" % self.queue.qsize()) #佇列物件qsize()方法,返回佇列的大小
            self.queue.task_done() #佇列物件在完成一項工作後,向任務已經完成的佇列傳送一個訊號

class EbaySpiderJob():

    def __init__(self , size , qs ):
        self.size = size  # 將形參size的值儲存到屬性變數size中
        self.qs = qs


    def work(self):
        toSpiderQueue = Queue() #建立一個Queue佇列物件
        for i in range(self.size):
            t = ThreadCrawl(toSpiderQueue)    #將例項用到一個類的方法中
            t.setDaemon(True)
            t.start()
        for q in self.qs:
            toSpiderQueue.put(q)  #呼叫佇列物件的put()方法,在對尾插入一個專案item
        toSpiderQueue.join()    #佇列物件,等到佇列為空,再執行別的操作

if __name__ == '__main__':

    df = pd.read_excel("ebay_sku_add1.xlsx")
    # print(df.info())
    qs = df[0].values
    print(len(qs))
    amazonJob = EbaySpiderJob(8, qs)
    amazonJob.work()

儲存到資料庫版本

"""
使用須知:
程式碼中資料表名 ebayItem ,需要更改該資料表名稱的注意更改 ebayItem

"""

import random
import urllib
from http.cookiejar import CookieJar
import requests
from bs4 import BeautifulSoup
import csv
import numpy as np
import xlrd
import os
import json
from queue import Queue
import time
import random
import threading
import logging
import pandas as pd
import pymysql

class Database():
    # 設定本地資料庫使用者名稱和密碼
    host = "localhost"
    user = "root"
    password = "******"
    database = "ebay"
    port = 3306
    charset = "utf8"
    cursor=''
    connet =''
    def __init__(self):
        #連線到資料庫
        self.connet = pymysql.connect(host = self.host , user = self.user,password = self.password , database = self.database, charset = self.charset)
        self.cursor = self.connet.cursor()
    # #刪表
    def dropTables(self):
        self.cursor.execute('''drop table if exists ebayItem''')
        print("刪表")
    def createTables(self):
        self.cursor.execute('''create table if not exists ebayItem
                        ( 
                            id int(11) primary key auto_increment,
                            ebayno  varchar(200) not null,
                            ebay_sku varchar(2000),
                            title varchar(2000),
                            description LONGTEXT,
                            specifics LONGTEXT,
                            fitment LONGTEXT
                        );''')
        print("建表")
    #儲存資料
    def save(self,aceslist):
        self.cursor.execute("insert into ebayItem ( ebayno, ebay_sku,title,description, specifics ,fitment) values(%s,%s,%s,%s,%s,%s)", (aceslist[0],aceslist[1],aceslist[2],aceslist[3],aceslist[4],aceslist[5]))
        self.connet.commit()
    #判斷元素是否已經在資料庫裡,在就返回true ,不在就返回false
    def is_exists_ebayno(self,ebayno):
        self.cursor.execute('select * from ebayItem where ebayno = %s',ebayno)
        if self.cursor.fetchone() is None:
            return False
        return True

class EbaySpider(object):
    def __init__(self):
        self.db = Database()
        self.SESSION = requests.session()
        self.SESSION.cookies = CookieJar()
        self.HEAD = self.randHeader()

    def randHeader(self):
        head_connection = ['Keep-Alive', 'close']
        head_accept = ['text/html, application/xhtml+xml, */*']
        head_accept_language = ['zh-CN,fr-FR;q=0.5', 'en-US,en;q=0.8,zh-Hans-CN;q=0.5,zh-Hans;q=0.3']
        head_user_agent = ['Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko',
                           'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; rv:11.0) like Gecko)',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.2) Gecko/2008070208 Firefox/3.0.1',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.1) Gecko/20070309 Firefox/2.0.0.3',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.1) Gecko/20070803 Firefox/1.5.0.12',
                           'Opera/9.27 (Windows NT 5.2; U; zh-cn)',
                           'Mozilla/5.0 (Macintosh; PPC Mac OS X; U; en) Opera 8.0',
                           'Opera/8.0 (Macintosh; PPC Mac OS X; U; en)',
                           'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080219 Firefox/2.0.0.12 Navigator/9.0.0.6',
                           'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0)',
                           'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)',
                           'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Maxthon/4.0.6.2000 Chrome/26.0.1410.43 Safari/537.1 ',
                           'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; QQBrowser/7.3.9825.400)',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0 ',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.92 Safari/537.1 LBBROWSER',
                           'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; BIDUBrowser 2.x)',
                           'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.11 TaoBrowser/3.0 Safari/536.11']
        header = {
            'Connection': head_connection[0],
            'Accept': head_accept[0],
            'Accept-Language': head_accept_language[1],
            'User-Agent': head_user_agent[random.randrange(0, len(head_user_agent))]
        }
        return header

    def get_sku(self,ebayno):
        ebayno = str(ebayno)
        if self.db.is_exists_ebayno(ebayno):
            return
        # http://developer.ebay.com/devzone/shopping/docs/callref/getsingleitem.html
        # Compatibility 	Description 	Details 	ItemSpecifics 	ShippingCosts 	TextDescription 	Variations
        url = "http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=JSON&" \
              "appid=yourappid&siteid=100&version=967&" \
              "IncludeSelector=Details,Description,ItemSpecifics,Compatibility&" \
              "ItemID=" + ebayno
        r = requests.get(url=url,headers = self.HEAD)
        item = json.loads(r.text)
        sku = item["Item"]["SKU"]
        title = item["Item"]["Title"]
        desc = item["Item"]["Description"]
        specific = item["Item"]["ItemSpecifics"]
        try:
            fitment = item["Item"]["ItemCompatibilityList"]
        except:
            fitment=""
        specific=repr(specific)
        fitment=repr(fitment)
        self.db.save([ebayno, sku, title, desc, specific, fitment])  # 儲存到資料庫

class ThreadCrawl(threading.Thread): #ThreadCrawl類繼承了Threading.Thread類

    def __init__(self, queue):  #子類特有屬性, queue
        FORMAT = time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime()) + "[AmazonSpider]-----%(message)s------"
        logging.basicConfig(level=logging.INFO, format=FORMAT)
        threading.Thread.__init__(self)
        self.queue = queue
        self.spider = EbaySpider()  #子類特有屬性spider, 並初始化,將例項用作屬性

    def run(self):
        while True:
            success = True
            item = self.queue.get() #呼叫佇列物件的get()方法從隊頭刪除並返回一個專案item
            self.spider.get_sku(item)  # 呼叫例項spider的方法getDataById(item)
            # try:
            #     self.spider.search(item) #呼叫例項spider的方法getDataById(item)
            # except :
            #     success = False
            # if not success :
            #     self.queue.put(item)
            logging.info("now queue size is: %d" % self.queue.qsize()) #佇列物件qsize()方法,返回佇列的大小
            self.queue.task_done() #佇列物件在完成一項工作後,向任務已經完成的佇列傳送一個訊號

class EbaySpiderJob():

    def __init__(self , size , qs ):
        self.size = size  # 將形參size的值儲存到屬性變數size中
        self.qs = qs

    def work(self):
        toSpiderQueue = Queue() #建立一個Queue佇列物件
        for i in range(self.size):
            t = ThreadCrawl(toSpiderQueue)    #將例項用到一個類的方法中
            t.setDaemon(True)
            t.start()
        for q in self.qs:
            toSpiderQueue.put(q)  #呼叫佇列物件的put()方法,在對尾插入一個專案item
        toSpiderQueue.join()    #佇列物件,等到佇列為空,再執行別的操作

if __name__ == '__main__':

    ####建立資料庫, 停止後接著跑就需要註釋
    # db = Database()
    # db.dropTables()
    # db.createTables()
    ####建立資料庫 end

    df = pd.read_excel("ebaynos.xlsx",sheetname="Sheet2")
    # print(df.info())
    qs = df["ebayno"].values
    print(len(qs))
    # qs = ["162799453400"]
    amazonJob = EbaySpiderJob(8, qs)
    amazonJob.work()


相關推薦

根據ebayno可見資訊 本地+資料庫 API

import random from http.cookiejar import CookieJar import requests from bs4 import BeautifulSoup import csv import numpy as np import re import xlrd import

python根據標籤網頁資訊

這裡以豆瓣TOP250為案例,爬取網頁資訊import requests#python HTTP客戶端庫,編寫爬蟲和測試伺服器響應資料會用到的類庫 import re from bs4 import B

java爬蟲 網站資訊 儲存資料庫

需求分析 1:爬取虎嗅首頁獲取首頁文章地址:https://www.huxiu.com/ 2:爬取虎嗅分頁地址,獲取分頁上的文章地址。 3:爬取文章詳情頁,獲取文章資訊(標題、正文、作者、釋出時間、評論數、點贊數、收藏數)。 4:將爬到的文章資訊入庫。 實現思路 1:爬首頁

Python網頁資訊並且儲存到MySQL資料庫

今天在執行一小Python爬取某網頁的資訊的時候,結果,報錯了,根據錯誤,應該是資料庫連線失敗,密碼有錯誤 檢查程式密碼應該沒錯呀,然後直接訪問資料庫,我的天,試了好多次,都快放棄自己了,昨晚明明成功的呀 然後開啟Navicat,檢視昨晚設定的連線屬性,沒錯呀,密碼就是

Python3爬蟲學習4:降資訊儲存到本地

將爬取的資訊儲存到本地 之前我們都是將爬取的資料直接列印到了控制檯上,這樣顯然不利於我們對資料的分析利用,也不利於儲存,所以現在就來看一下如何將爬取的資料儲存到本地硬碟。 1.對.txt檔案的操作 讀寫檔案是最常見的操作之一,python3 內建了讀寫

第一週、學會網頁資訊總結

目標:爬取網頁,獲得自己需要的資訊步驟:1. 匯入需要的模組2. 利用request向目標網站獲得網頁資訊3. 用BeautifulSoup解析所獲得的網頁 3. 獲得需要的資訊所在的標籤內容 4. 精簡標籤獲得關鍵資訊5. 獲得關鍵資訊之後,再處理(比如比大小)1、匯入需要的模組BeautifulSoup模

基於ThinkPHP5 使用QueryList 並存入mysql資料庫

QueryList4教程  地址: https://doc.querylist.cc/site/index/doc/45 在ThinkPHP5程式碼根目錄執行composer命令安裝QueryList: composer require jaeger/querylist

PHP 結合前端 ajax 網站資訊後, 向指定使用者傳送指定簡訊;

<?php /** * Description * @authors Your Name ([email protected]) * # 根據時時彩的最新一期的號碼, 判斷如果為首尾同號則傳送簡訊 * - phpQuery 分析網頁, 獲得網頁資料, 獲得html資料 *

c# 爬蟲商品資訊

    在一個小專案中,需要用到京東的所有商品ID,因此就用c#寫了個簡單的爬蟲。     在解析HTML中沒有使用正則表示式,而是藉助開源專案HtmlAgilityPack解析HTML。 一、下載網頁HTML     首先我們寫一個公共方法用

使用HtmlAgilityPack網站資訊並存儲

前言:打算做一個藥材價格查詢的功能,但剛開始一點資料都沒有靠自己找資訊錄入的話很麻煩的,所以只有先到其它網站抓取存到資料庫再開始做這個了。 HtmlAgilityPack在c#裡應該很多人用吧,簡單又強大。之前也用它做過幾個爬取資訊的小工具。不過很久了原始碼都沒有了,都忘了怎麼用了,這次也是一點

Python天氣資訊並定時傳送給微信好友(異地戀神器)!!

效果 前言 中國天氣網: http://www.weather.com.cn/ 點選右上角的具體的天氣資料 想獲取哪個城市的天氣,就搜尋城市進行切換 這裡以青島為例 可以看到此時url為: http://www.weather.com.cn/weat

使用PhantomJS股票資訊

寫在前面 前一段時間使用python+PhantomJS爬取了一些股票資訊,今天來總結一下之前寫的爬蟲。 整個爬蟲分為如下幾個部分, 爬取所有股票列表頁的資訊 爬取所有股票的詳細資訊 將爬取到的資料寫入cvs檔案中,每一種股票為一個CSV檔案 爬取所

爬蟲基礎-2-招聘資訊

小生部落格:http://xsboke.blog.51cto.com -------謝謝您的參考,如有疑問,歡迎交流 注意:BOSS應該是做了防爬蟲的功能,好像是如果頻繁訪問,就需要輸入一下驗證碼.為了節省時間,當前只爬取了熱門城市的python相關職位資訊

scrapy根據關鍵字google圖片

瀏覽器的圖片都是通過Ajax非同步載入的,通過瀏覽器F12的network下的XHR可以看到,當往下拉動載入更多圖片時,XHR會加載出 許多內容,可以判定我們所需的資料可以通過這個介面拿到。下面是程式碼; spiders檔案 # -*- coding: utf-8 -*

python 3.x 爬蟲基礎---正則表示式(案例:貓眼資訊,寫入txt,csv,下載圖片)

python 3.x 爬蟲基礎 前言   正則表示式是對字串的一種邏輯公式,用事先定義好的一些特定字元、及這些特定字元的組合,組成一個“規則的字串”,此字串用來表示對字串的一種“過濾”邏輯。正在在很多開發語言中都存在,而非python獨有。對其知識點進行總結後,會寫一個demo。 1.正

python 爬蟲 如何通過scrapy框架簡單網站資訊--以51job為例

Scrapy框架三大優點: Scrapy框架是用純Python實現一個為了爬取網站資料、提取結構性資料而編寫的應用框架,用途非常廣泛。 框架的力量,使用者只需要定製開發幾個模組就可以輕鬆的實現一個爬蟲,用來抓取網頁內容以及各種圖片,非常之方便。 Scrapy

使用selenium餐廳資訊

一 工具及平臺介紹 使用python語言爬取 使用BeautifulSoup解析 爬取餐廳資訊——大眾點評某個地區的餐廳列表 匯入到CSV資料夾下 使用谷歌瀏覽器 二 程式碼主要部分解析 1.使用的庫: from selenium import webd

多網頁NBA資訊

  看到多網頁爬取肯定感覺很高階大氣上檔次吧!其實鬼都不是。我們現來分析下網頁 其實網址就是字尾不一樣而已。那應該怎們處理呢 url = 'https://nba.hupu.com/teams/' + list_name[i] 就這樣就搞定了。 剩下的就開始爬去NBA

python爬蟲學習 之 定向 股票資訊

一、功能描述 目標:獲取上交所和深交所所有股票的名稱和交易 資訊 輸出:儲存到檔案中 技術路線:requests-bs4-re 二、 選取原則:股票資訊靜態存在於HTML頁面中,非js程式碼生成,沒有robots協議限制 三、程式的結構設計

python身份證資訊ip代理池

  匹配的分類 按照匹配內容進行匹配               我們在匹配的過程當中,按照要匹配的內容的型別和數量進行匹配  &nb