How to get URL path in Python

1 Answer

0 votes
from urllib.parse import urlparse

url = 'https://www.buyfrompictures.com/silver-cypress-chamecyparis-pisifera-boulevard/'

parsed = urlparse(url)

path = parsed.path

print(path)  




'''
run:

/silver-cypress-chamecyparis-pisifera-boulevard/

'''

 



answered Jul 21, 2022 by avibootz

Related questions

1 answer 163 views
1 answer 184 views
1 answer 247 views
247 views asked Mar 10, 2020 by avibootz
1 answer 179 views
1 answer 192 views
192 views asked Mar 10, 2017 by avibootz
...