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 147 views
1 answer 178 views
1 answer 241 views
241 views asked Mar 10, 2020 by avibootz
1 answer 176 views
1 answer 189 views
189 views asked Mar 10, 2017 by avibootz
...