Atul Anand
Atul Anand

Reputation: 29

How to Scrape Shopify Website Using Beautiful Soup and Get All the Tags(#)

I am trying to find all the # elements in a particular webpage by using Beautiful Soup.

import requests
from bs4 import BeautifulSoup as Soup


source = "https://www.runinrabbit.com/"


def getPageContents(source):

    req = requests.get(source)
    print("req : ",req,type(req))
    print("***************************")
    content = Soup(req.text, 'html.parser')
    print("content data",type(content),content)
    return content

Like the content, I am just getting everything else but the tagged value.

e.g., Strings with tags, like below is not getting printed in my function: getPageContents.

#marathoner, #winner, #runinrabbit, #topoathletic, #hartfordmarathon, #rabbitpro, #marathon, #olympictrials, #runnergirl, #winning, #finisher, #run, #running, #runner, #runnersofinstagram, #runnersworld, #runnerscommunity, #breezyback, #lightweight, #simple, #runinrabbit, #borntorunfree, #breezyback, #lightweight, #simple, #runinrabbit, #borntorunfree", #racerollcall, #racetime, #runfast, #goodluck, #RADrabbit, #rabbitELITE, #rabbitELITEtrail, #rabbitPRO, #runinrabbit, #borntorunfree"

Upvotes: 2

Views: 407

Answers (0)

Related Questions