I am trying to split a url string in Python 3.
The code is like this.
url = 'https://www.jstage.jst.go.jp/browse/mesj/58/1-2/_contents/-char/en' url = url.replace('https://www.jstage.jst.go.jp/browse/', '') j, v, n, _ = url.split('/') print(j, v, n) I want to extract journal name, volume and number from a url.
But there is an error like this.
user@users-MacBook-Pro-5 ~ % /usr/bin/python3 /Users/user/Downloads/test.py Traceback (most recent call last): File "/Users/user/Downloads/test.py", line 5, in <module> j, v, n, _ = url.split('/') ValueError: too many values to unpack (expected 4) Any suggestion?