Access desired posts through Python string search.

Asked 2 years ago, Updated 2 years ago, 76 views

This is the code I wrote so far.

The purpose is to enter the article with the title of the bulletin board with the desired word

First of all, I even wrote the title and link of the post to include it in the name and href list

I'm trying to find the name index of the post I want through a string search and enter getURL again through href

I tried to find it as an index function, but it was blocked because it had to match exactly... I'm trying to use the string module, but I don't have a clue.

Or is there a completely different way? Maybe it's because I was doing C, but it feels like it's spinning.

python string crawling

2022-09-22 14:27

1 Answers

Um... would you like to try this?

for title in my_titles :
    if "wanted string" title.get_text():
        name.append(title.get_text())
        href.append(title['href'][2:])

Learn more about Python string in operators


2022-09-22 14:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.