2017-12-19 11 views
0

中節から段落の抽出:私はヘッダーすなわち「スティーブンD.ベックを取得することができていますVBA-私は、このリンクから記事の各セクションからテキストを抽出したいIE

http://iuhealth.org/search/results/global/Memorial%20Sloan%20Kettering%20Cancer%20Center/P1/

Slink = "http://iuhealth.org/search/results/global/Memorial%20Sloan%20Kettering%20Cancer%20Center/P1/" 
With httpRequest 
    .Open "GET", Slink, False 
    .setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
    .send 
End With 
With httpRequest 
    While Not .readyState = 4 
     Application.Wait Now + TimeValue("0:00:01") 
    Wend 
    If .Status = 200 Then 
     While InStr(1, .responseText, "Updating", 0) > 0 
      Application.Wait Now + TimeValue("0:00:01") 
     Wend 
     Set oHtml = New HTMLDocument 
     oHtml.body.innerHTML = .responseText 
    End If 
End With 

ReDim title(0) 
ReDim LinkS(0) 
ReDim Spec(0) 

Set aelem = oHtml.getElementsByTagName("article") 
MsgBox aelem.Length 
For Each ele In aelem 

Next ele 

を、 MD |医者を探す| IU Health " しかし段落はありません。

答えて

0

私はWebテストフレームワークSeleniumを使用し、そのために書かれたVBAラッパーがあります。 https://codingislove.com/browser-automation-in-excel-selenium/を読んでください。私の経験から

一つのヒント:https://florentbr.github.io/SeleniumBasic/からSeleniumBasicをインストールした後は、Chromeを使用している場合は、Cを交換する必要があります:\ユーザーは、最新のchromedriver.exeとyour_Windows_ID \のAppData \ローカル\ SeleniumBasicの\ chromedriver.exeを\ https://sites.google.com/a/chromium.org/chromedriver/

+0

いいえCbasah。私はまだアドインから解決策を見つけることができません。 – Aditya

関連する問題