I sorta mix together codes i copy pasted everywhere to achieve what i want but i felt it is rather weird and probably not so efficient/not pythonic. So what i tried to get is substitute the last item in the url after "/" by incremental value of 1 and then append to the list "url_pages".
["https://www.jobstreet.com.my/en/job-search/{pos}-jobs-in-{loc}/1", "https://www.jobstreet.com.my/en/job-search/{pos}-jobs-in-{loc}/2", .....]
i read that %s is for python 2.x while f-string is the modern way so is there any way to achieve this not using %s.
selectpage = soup.find("select", id="pagination")
maxpage = int(selectpage.find_all("option")[-1].get("value"))
url_page = []
i = 1
pos = input(str("input pos: ")).replace(" ", "-")
loc = input(str("input loc :")).replace(" ", "-")
finalurl = f"https://www.jobstreet.com.my/en/job-search/{pos}-jobs-in-{loc}/%s"
for i in range(1,maxpage+1):
if i <= maxpage:
url_page.append(finalurl % i)
else:
print("exceeded max page")
i += 1
print(url_page)
Thanks.