Beautiful Soup Get Data Bind Element

Question:

<div class="col-xs-12 col-sm-2">
                    <span class="small text-muted">Court</span>
                </div><div class="col-xs-11 col-xs-offset-1 col-sm-10 col-sm-offset-0">
                    <span class="small" data-bind="html: model.Court">Wayne Township</span>



from bs4 import BeautifulSoup

response_soup = BeautifulSoup(response.text, 'html.parser')

court = response_soup.find('span', {'class': 'Model.court'}).text

The result is NONE
I am trying to get Wayne Township
Wayne Township will not always be the result.
Any assistance would be most appreciated.

Asked By: chatmomma

||

Answers:

I figured it out. I had to add selenium The correct syntax is court=browser.find_element(By.XPATH,"//span[@data-bind=’html: model.Court’]")

Answered By: chatmomma
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.