|
下記のコードに変更してください。
Private Sub ExYahooSearch(shtml As String)
Dim ln1 As Long
Dim ln2 As Long
Dim ln3 As Long
Dim s1 As String
Dim s2 As String
'検索件数を調べる
ln3 = 0
ln1 = InStr(1, shtml, "件目 / 約<strong>")
If ln1 > 0 Then
ln2 = InStr(ln1, shtml, "</strong>")
s1 = Mid(shtml, ln1 + Len("件目 / 約<strong>"), ln2 - (ln1 + Len("件目 / 約<strong>")))
ln3 = s1
End If
s1 = "http://www.feedsoft.net/excel/"
If Left(LCase(s1), 7) = "http://" Then
s2 = Mid(s1, 8, Len(s1) - 7)
Else
s2 = s1
End If
If Right(s2, 1) = "/" Then
s1 = Left(s2, Len(s2) - 1)
End If
s2 = ""
ln1 = InStr(1, shtml, s2)
'見つかれば
If ln1 > 0 Then
s1 = "=WS1/R="
ln2 = InStr(ln1 - 200, shtml, s1)
If ln2 > 0 And ln2 < ln1 Then
s1 = "/wdm="
ln3 = InStr(ln2, shtml, s1)
s2 = Mid(shtml, ln2 + 7, ln3 - (ln2 + 7))
End If
End If
'ブックマーク表示があるのでその次の位置から調べる
ln1 = InStr(ln1 + 1, shtml, s2)
'見つかれば
If ln1 > 0 Then
s1 = "=WS1/R="
ln2 = InStr(ln1 - 200, shtml, s1)
If ln2 > 0 And ln2 < ln1 Then
s1 = "/wdm="
ln3 = InStr(ln2, shtml, s1)
s2 = Mid(shtml, ln2 + 7, ln3 - (ln2 + 7))
End If
End If
End Sub
|
|
|
|