Python 需要使用beautiful soup按名称获取特定节点吗?

Python 需要使用beautiful soup按名称获取特定节点吗?,python,web-scraping,beautifulsoup,Python,Web Scraping,Beautifulsoup,我有4个url..现在我需要url的袖子详细信息..袖子详细信息更改位置,因此存储它的节点也更改…对于第一个url,袖子位于第二位置,对于其他三个url,袖子位于第三位置..我需要如下输出 URLS Sleeves http://www.jabong.com/belle-fille-Green

我有4个url..现在我需要url的袖子详细信息..袖子详细信息更改位置,因此存储它的节点也更改…对于第一个url,袖子位于第二位置,对于其他三个url,袖子位于第三位置..我需要如下输出

URLS                                                                                                        Sleeves
http://www.jabong.com/belle-fille-Green-Solid-Winter-Jacket-1310755.html?pos=5&cid=BE797WA44OZRINDFAS   Full Sleeves
http://www.jabong.com/oxolloxo-Off-White-Solid-Reversible-Blazer-2687327.html?pos=8&cid=OX344WA72XITINDFAS  Long Sleeve
http://www.jabong.com/oxolloxo-Multicoloured-Checked-Blazer-2784283.html?pos=16&cid=OX344WA16KTVINDFAS  3/4th Sleeves
http://www.jabong.com/mirika-Blue-Embellished-WINTER-JACKET-2754538.html?pos=19&cid=MI137WA61STUINDFAS  Sleeveless
以下是我的代码部分:

for 1st url : soup.find_all("span", {"class":"product-info-left"})[1].next_sibling.text

for 2nd to 4th url : soup.find_all("span", {"class":"product-info-left"})[2].next_sibling.text

您只能找到包含
'Sleeve'
的字符串

def check(text):
    return type(text) != type(None) and text.find('Sleeve') > -1

sleeves = soup.find_all(string=check)
print(sleeves[1])
输出

要学习使用函数过滤,请选中此项

def check(text):
    return type(text) != type(None) and text.find('Sleeve') > -1

sleeves = soup.find_all(string=check)
print(sleeves[1])
Full Sleeves
Long Sleeve
3/4th Sleeves
Sleeveless