springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 12:34:27
145
我想从一个类中提取一个href标签,我该怎么做?这是我的代码:
from bs4 import BeautifulSoup
import requests
from pprint import pprint
def search_manga(titolo):
i = 0
e = 0
base_url = "https://beta.mangaeden.com/it/it-directory/?title="
titolo = titolo.replace(" ", "+")
url = base_url + titolo
r = requests.get(url)
soup = BeautifulSoup(r.content, "html.parser")
manga_list = soup.find(id = 'mangaList')
a_tag = manga_list.find_all(class_='openManga')
print(a_tag)
a_tag_array=[]
for link in a_tag:
link = a_tag.get('href')
print(link)
manga_name = input("inserisci il nome del manga: ")
search_manga(manga_name)
输出如下:
AttributeError:ResultSet对象没有属性“ Get ”。您可能将元素列表视为单个元素。当您打算调用find()时,是否调用了find_all()?
我该怎么解决?
顺晟科技:
查看查询的HTML响应,似乎只有一个元素具有类“ OpenManga ”。因此,这可以简化如下:
AttributeError: ResultSet object has no attribute 'get'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11