小编ImN*_*bot的帖子

Beautiful Soup 中 find_all 方法的返回类型是什么?

from bs4 import BeautifulSoup, SoupStrainer 
from urllib.request import urlopen
import pandas as pd 
import numpy as np 
import re
import csv
import ssl
import json
from googlesearch import search
from queue import Queue
import re 

links = []
menu = []
filtered_menu = []


def contains(substring, string):
     if substring.lower() in string.lower():
         return True
     else:
         return False


for website in search("mr puffs", tld="com", num=1, stop=1, country="canada", pause=4): 
 links.append(website)


soup = BeautifulSoup(urlopen(links.pop(0)), features="html.parser")
menu = soup.find_all('a', href=True)

for string in menu:
    if …
Run Code Online (Sandbox Code Playgroud)

python regex beautifulsoup web-scraping

6
推荐指数
1
解决办法
6414
查看次数

标签 统计

beautifulsoup ×1

python ×1

regex ×1

web-scraping ×1