Issue
Here the HTML Code:
<h4 class="page-header">
" (111) Senior "
<small>
<font class="small">
<i class="glyphicon glyphicon-road">
::before
</i>
" Street 8.9 "
<a href="htttp://" target="_blank">(master refrence)</a>
</font>
</small>
</h4>
My Python Code:
print("new adress: " + driver.find_element(By.CLASS_NAME, "small").text)
My Result:
new address: (Verification data, according to school updates)
I want result like this:
new address: Street 8.9
Anyone have suggesion of my problem?
Solution
You'd better use find_element_by_css_selector
function.
print("new adress: " + driver.find_element_by_css_selector("h4.page-header font.small").text)
Answered By - David Lu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.