Hey there! Sign in to join this conversationNew here? Join for free
x Turn on thread page Beta

using beautiful soup to find_all multiple class names watch

Announcements
    • Thread Starter
    Offline

    2
    ReputationRep:
    I searched thoroughly for solution on many websites and on here but none of them works!I am trying to scrap flashscores.com and i want to parse a with the class name 'cell_ab team-home ' or 'cell_ab team-home bold '

    I tried using re

    Code:
    soup.find_all('td', { 'class'= re.compile(r"^(cell_ab team-home |cell_ab team-home  bold )$")
    )

    and

    Code:
    soap.find_all('td', { 'class' : ['cell_ab team-home ','cell_ab team-home  bold '])
    neither of them works.
    Offline

    3
    ReputationRep:
    According to the docs you should be doing something like this:
    Code:
    soup.find_all("td", class_=re.compile("cell_ab team-home | cell_ab team-home  bold"))
 
 
 
Reply
Submit reply
Turn on thread page Beta
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: May 10, 2015
Poll
Do you agree with the proposed ban on plastic straws and cotton buds?
Useful resources

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.