3

I am trying to scrap information from multiple web sites.

<div class="detailSection">
        <span>Officer/Director Detail</span>
            <span><b>Name & Address</b></span>
            <br/>
            <br/>
     <span>Title&nbsp;VD</span>
     <br/>
     <br/>
GUNN, BETTY    <span>

<div>
6922 SOUTH LAGOON DR<br/>
         PANAMA CITY BEACH, FL 32408<br/>
</div>

I am able to pull all of the information except for the name "GUNN, BETTY".

The web page is http://search.sunbiz.org/Inquiry/CorporationSearch/SearchResultDetail?inquiryType=DocumentNumber&aggregateId=domnp-763425-68d63992-2677-4bd5-9e1e-3f63ef505809&directionType=Initial&searchNameOrder=AMBASSADORBEACHOWNERSASSOCIATI%207634250&searchTerm=763425

Officer_Director_Detail2 = Doc.getElementsByClassName("detailSection")(5).getElementsByTagName("span")(2).innerText copies "Title VD".

Officer_Director_Detail3 = Doc.getElementsByClassName("detailSection")(5).getElementsByTagName("span")(3).innerText copies "6922 SOUTH LAGOON DR PANAMA CITY BEACH, FL 32408".

I have tried using "br" and "div" but neither will copy the name. HELP!!!

2 Answers 2

1

try this code and select the fields (txt(i)) you are interested in 'BETTY GUNN, is at txt(5)

txt = Split(doc.getElementsByClassName("detailSection")(5).innerText, vbCrLf)
For i = 0 To UBound(txt)
MsgBox i & ":" & txt(i)
Next i
Sign up to request clarification or add additional context in comments.

Comments

0

Sadly you can't use XPath of a text node but can get just that string using Split in selenium using XPath. This uses selenium type library reference after installing selenium basic.

Option Explicit
Public Sub GetInfo()
    Dim d As WebDriver, arr() As String
    Set d = New ChromeDriver
    Const URL = "http://search.sunbiz.org/Inquiry/CorporationSearch/SearchResultDetail?inquiryType=DocumentNumber&aggregateId=domnp-763425-68d63992-2677-4bd5-9e1e-3f63ef505809&directionType=Initial&searchNameOrder=AMBASSADORBEACHOWNERSASSOCIATI%207634250&searchTerm=763425"
    With d
        .AddArgument "--headless"
        .Start "Chrome"
        .get URL
        Debug.Print Split(.FindElementByXPath("//*[@id='maincontent']/div[2]/div[6]").Text, Chr$(10))(5)
        .Quit
    End With
End Sub

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.