I only want to print from http:/ to & from the following string: I tried using the split, but I think it only works once Is there any other way?
python
text = "/url?q=http://news.khan.co.kr/kh_news/khan_art_view.html%3Fartid%3D201609071726232%26code%3D900303&sa=U&ved=0ahUKEwjoyIyA-azZAhUBxJQKHcUsAdEQFgg9MAk&usg=AOvVaw1RSpZpTtFdousoApHGk4-next"
a = text.find('http:/')
b = text.find('&')
print(text[a:b])
Results
http://news.khan.co.kr/kh_news/khan_art_view.html%3Fartid%3D201609071726232%26code%3D900303
Are you sure you want to print this out?
© 2024 OneMinuteCode. All rights reserved.