Home > other >  How to use python's bs4 extract multiple tags of a certain attribute
How to use python's bs4 extract multiple tags of a certain attribute

Time:09-18

CodePudding user response:

I don't want to send this TWO extracted star rating for advice!

CodePudding user response:

CodePudding user response:

Advised to find regular, and with regular,

CodePudding user response:

reference DFGGGGG reply: 3/f
advice to find regularity, and then with a regular,
my small white one... But still thank you

CodePudding user response:

reference 1st floor whileTrue_learn response:
I don't want to send this TWO extracted star rating for advice!

The label attribute STR. After the split () [1]

CodePudding user response:

Can't, the extraction is a piece of extracted, you can use the slice method such as part of a display

CodePudding user response:

reference 5 floor JMZL reply:
Quote: refer to 1st floor whileTrue_learn response:
I don't want to send this TWO extracted star rating for advice!

After the label attribute STR. The split () [1] segmentation
thank you!

CodePudding user response:

refer to 6th floor max5173 response:
can't, attribute extraction is a piece of extracted, you can use the slice method is part of a display, such as
thank?? !

CodePudding user response:

This requirement is a little strange, maybe I understand wrong

CodePudding user response:

references 9 f dabingsou response:
this demand is a little strange, maybe I understand wrong
haha that's a rating evaluation class I want to send this climb out

CodePudding user response:

references to the tenth floor whileTrue_learn response:
Quote: references 9 f dabingsou response:
this demand is a little strange, maybe I understand wrong
haha that's a rating evaluation class I want to send this climb out
understand, that is in accordance with the said above, pulled out of the class, and then split the

CodePudding user response:

11 references dabingsou response:
Quote: reference to the tenth floor whileTrue_learn response:

Quote: references 9 floor dabingsou response:
this demand is a little strange, maybe I understand wrong
haha that's a rating evaluation class I want to send this climb out
understand, that is in accordance with the said above, pulled out of the class, and then split the
that is the class there are so many... And star rating - one, two three is not the same with what method should I put the class=star rating - * * * this extracted

CodePudding user response:

If every class is the star rating + * * *, you can use the above said they split it. The split () [1]

CodePudding user response:

reference 13 floor dabingsou reply:
if every class is the star rating + * * *, you can use the above said they split it. The split () [1]
the segmentation as though it were extracted and then extract the attribute of one, two three use don't know what kind of keywords can attribute extracted from

CodePudding user response:

reference 5 floor JMZL reply:
Quote: refer to 1st floor whileTrue_learn response:
I don't want to send this TWO extracted star rating for advice!

After the label attribute STR. The split () [1] segmentation
great god also trouble again ask me what I should use keywords to class=star - rating * * are extracted from this class attribute... Behind him one, two three different thank you

CodePudding user response:

reference 15 floor whileTrue_learn response:
Quote: refer to the fifth floor JMZL reply:
Quote: refer to 1st floor whileTrue_learn response:
I don't want to send this TWO extracted star rating for advice!

After the label attribute STR. The split () [1] segmentation
great god also trouble again ask me what I should use keywords to class=star - rating * * are extracted from this class attribute... Behind him one, two three different thank you


Give you an example of using simplified_scrapy library, need to install the PIP install simplified - scrapy
 the from simplified_scrapy. Simplified_doc import SimplifiedDoc 
Doc=SimplifiedDoc ()
Print (doc. GetElementByClass (" star - rating ", '& lt; P & gt;
  • ') [r]. "the class" the split () [1])
    nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
    • Related