1
jlink1=[]
import time
#for url in l2:
jdata=len(l2)
for i in range(jdata):
    time.sleep(0.5)
    url =l2[i] 
    page = requests.get(url).content
    soup = BeautifulSoup(page, 'html.parser')     
    for tr in soup.find_all('td', attrs={'class':'fsdfsdfsdfsdfi'}):
        sikko1 =[ x.get("href") for x in tr.find_all('a',)]  
        jlink1.append(sikko1)    
        print(sikko1)
['../Page/../sdfsdfsdfsdf']
['../Page/../sdfsfsdfsdfsdfsdf']
['../Page/../sdfsfsdfsdfsdfsfsfd']
['../Page/../sdfsfsdfsfsdfsdfsdf']

İ have just like this list and can't convert string for use this code

jlink1.replace('../..','https://www.blablfsddfda.com')

Help please

2
  • 1
    please share your full code. Commented May 25, 2020 at 2:25
  • Please add more details related to what you are trying to achieve. Thanks! Commented May 25, 2020 at 2:52

1 Answer 1

2

replace the following piece of code:

sikko1 =[ x.get("href") for x in tr.find_all('a',)]

to the following:

sikko1 =[ x.get("href").replace('../','https://www.blablfsddfda.com') for x in tr.find_all('a',)]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.