0

I have an HTML document from which I scrape some data using

data=content.find_all("a", {"class": "result-title"})

Then data as below:

[ < a class = "result-title hover_feedback zred bold ln24 fontsize0 "
    data - result - type = "ResCard_Name"
    href = "https://www.zomato.com/bangalore/flechazo-marathahalli"
    title = "flechazo Restaurant, Marathahalli" > Flechazo <
    /a>]

Now I wanted extract from data is 01. https://www.zomato.com/bangalore/flechazo-marathahalli 02. Flechazo

Any help would be appreciated.

2
  • 1
    I doubt that your data looks like this, with syntax errors all over the place. Commented Jun 11, 2018 at 19:12
  • Could we please have your exact output and input. Your output is invalid syntax Commented Jun 11, 2018 at 19:14

1 Answer 1

1

this will help

links = content.find_all("a", {"class": "result-title"})    
for link in links:
    print(link.get('href', None))
    print(link.text)

Output

https://www.zomato.com/bangalore/flechazo-marathahalli
Flechazo 
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.