9/28
Part 3 of 6 · Clean linksLearn and do
Drop the fragment: /b#top is the page /b
The second step: the part after # names a place on a page, not a different page.
from urllib.parse import urldefrag
print(urldefrag("http://example.com/b#top"))
for link in ["http://example.com/b#top", "http://example.com/b#part"]:
print(urldefrag(link).url)
What does urldefrag("http://example.com/b#top").url give?
Pick one to see what it prints.
Pick an answer above to see the rest