Python BeautifulSoup give multiple tags to findAll
Question: I'm looking for a way to use findAll to get two tags, in the order they appear
on the page.

Currently I have:

    
    
    import requests
    import BeautifulSoup
    
    def get_soup(url):
        request = requests.get(url)
        page = request.text
        soup = BeautifulSoup(page)
        get_tags = soup.findAll('hr' and 'strong')
        for each in get_tags:
            print each
    

If I use that on a page with only 'em' or 'strong' in it then it will get me
all of those tags, if I use on one with both it will get 'strong' tags.

Is there a way to do this? My main concern is preserving the order in which
the tags are found.


Answer: You could [pass a
list](http://www.crummy.com/software/BeautifulSoup/bs4/doc/#a-list), to find
either `hr` or `strong` tags:

    
    
    tags = soup.find_all(['hr', 'strong'])
    

