I want to use regular expressions to get nofollow.

Asked 1 years ago, Updated 1 years ago, 52 views

I would like to extract only the ones with rel=nofollow on the outgoing link of example.com from various URLs using beatifulsoup.

I've only used VBA, so I think it's like this, but I'd appreciate it if you could point it out.

df=re.findall("http.*?"&example.com&".*?rel=(.*?)>",soup)

python python3 regular-expression

2022-09-30 16:17

1 Answers

Judging from the information I have now, I think it's like the following.
This is a regular expression that hits the appropriate URL from the URL set to href in a tag.

(?<=href=['])https?://example.com/.*rel=nofollow.*(?=['])


2022-09-30 16:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.