0
votes

I want to scrape resultColumn from a website and i cannot have the results my code:

from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup

my_url = 'https://www.nab.com.au/locations?return#lunch'

uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()

page_soup = soup(page_html, "html.parser")

containers = page_soup.findAll("div",{"class":"row collapse"})

containers[6].findAll("div","id":"resultColumn") 

result column has some results, it does not provide me those results and only displays "<!-- Results -->" Any help would be appreciated

1

1 Answers

0
votes

This is what I'm seeing for the page source surrounding the result column:

<div class="row collapse">
        <div class="large-4 small-12 columns tabContent" id="results-list-tab">
            <div id="resultColumn">
                <!-- Results -->
            </div>                      
            <div id="directionsPanel" class="border cf">
                <div id="directionsNav" class="cf"> 
                    <h3>Directions</h3>
                    <a href="javascript:closeDirectionsPanel();" class="arrow">Return to Results</a>
                </div>  
                <div id="directionsContent" class="cf"></div>
            </div>
        </div>        
        <div class="large-8 small-12 columns tabContent active" id="map-tab">
            <div id="map_canvas" class="border"></div>
            <table class="legend">
                <tbody>
                    <tr>
                      <td colspan="6"><h3>Legend</h3></td>
                    </tr>
                    <tr>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/atm-with-deposits.png" alt="ATM - with deposit facility"></td>
                        <td class="description">ATM - with deposit facility</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/atm.png" alt="ATM - without deposit facility"></td>
                        <td class="description">ATM - without deposit facility</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/audio-accessable.png" alt="ATM - with audio access"></td>
                        <td class="description">ATM - with audio access</td>
                    </tr>
                    <tr>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/disabled-access.png" alt="ATM - with disabled access"></td>
                        <td class="description">ATM - with disabled access</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/branch.png" alt="Branch"></td>
                        <td class="description">Branch</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/business-banking.png" alt="Business Banking Centre"></td>
                        <td class="description">Business Banking Centre</td>
                    </tr>
                    <tr>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/agency.png" alt="Agency"></td>
                        <td class="description">Agency</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/financial services-centre.png" alt="Financial Services Centre"></td>
                        <td class="description">Financial Services Centre</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/financial-planner.png" alt="Financial Planner"></td>
                        <td class="description">Financial Planner</td>
                    </tr>
                    <tr>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/mobile-banker.png" alt="Mobile Banker"></td>
                        <td class="description">Mobile Banker</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/kiosk.png" alt="Internet Banking Kiosk"></td>
                        <td class="description">Internet Banking Kiosk</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/coin-swap-machine.png" alt="Coin Swap Machine"></td>
                        <td class="description">Coin Swap Machine</td>
                    </tr>
                    <tr>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/quick-change-machine.png" alt="Quick Change Machine"></td>
                        <td class="description">Quick Change Machine</td>
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/express-business-deposit.png" alt="Express Business Deposit"></td>
                        <td class="description">Express Business Deposit</td>                
                        <td><img src="/etc/designs/nabrwd/clientlibs-locations/images/services/small-business-banker.png" alt="Small Business Banker"></td>
                        <td class="description">Small Business Banker</td>                
                    </tr> 
                </tbody>
            </table>
        </div>
    </div>

The only thing inside the tag is what you are getting from your code.

<!-- Results -->