I'm asking you a question because I can't solve it even if I google it and read the official document. The problem is as below.
After parsing, I want to output only one link address corresponding to href from the output result below.
// Code statement.
Attempt to extract the href element of the first tag from the parsed output statement.
li There are two hrefs in the tag
<a> below the class, and in this case, how can only one be output?
I wonder if you can.
Check the format of the return.
You can't? Is it really not working? Aren't you doing it the wrong way, not the way I explained earlier?
Aaa is returned to the list, but how did the result of the result set come out?
If it's Python Beautiful Soup... There's also a function called find Look it up
The code is as follows:
Parsed html to be extracted.
I also tried it with the revised content, The link address is printed normally Like the image, the tag text was printed in duplicate.
So I posted a question because I thought I should do something more within the tag so that I don't get duplicate content.
I don't know why the tag is duplicated on the link address.
© 2022 pinfo. All rights reserved.