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 134 views
1 answer 170 views
1 answer 232 views
232 views asked Mar 10, 2020 by avibootz
1 answer 168 views
1 answer 174 views
174 views asked Mar 10, 2017 by avibootz
...