So I've Been running the internet, and found this code.. ive been able to pull various data, but still having a great deal of issues with this area:
Series_V1.xlsm Located in the Scraping Module
'having alot of issues here
Set sht = Sheets("Sheet1")
RowCount = 1
Set title = .document.getElementsByName("title=")
If Not title = "" Then
sht.Range("M" & RowCount) = title.Item(0).Value
End If
Right now I'm just dumping code into sheet1 to connect the dots, but anyone willing, i would still very much appreciate a clue
Sub Need_A_Clue()
Dim objIE As InternetExplorer
Dim lRow As Long
Dim abc As String
Dim striEst As String
Dim ele As Object
Dim Airdate As Variant
Dim title As Object
Dim i As Long
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Visible = False 'true
.Navigate "http://www.imdb.com/title/tt1520211/episodes?season=1"
For lRow = 2 To 2
Do While .Busy Or _
.ReadyState <> 4
DoEvents
Loop
Set sht = Sheets("Sheet1")
RowCount = 1
For Each itm In .document.all
'If itm.tagname = "DIV" And itm.classname = "airdate" Then sht.Range("C" & RowCount) = Left(itm.innerText, 1024)
'If itm.tagname = "DIV" And itm.classname = "" And itm.ID = "" Then sht.Range("A" & RowCount) = Left(itm.innerText, 1024) 'And Left(itm.innertext, 2) = "S1"
'If itm.tagname = "STRONG" And itm.classname = "" And itm.ID = "" Then sht.Range("B" & RowCount) = Left(itm.innerText, 1024)
'If itm.tagname = "DIV" And itm.classname = "item_description" And itm.ID = "" Then sht.Range("D" & RowCount) = Left(itm.innerText, 1024)
sht.Range("A" & RowCount) = itm.tagname
sht.Range("B" & RowCount) = itm.classname
sht.Range("C" & RowCount) = itm.ID
sht.Range("D" & RowCount) = Left(itm.innerText, 1024)
RowCount = RowCount + 1
'having alot of issues here
Set sht = Sheets("Sheet1")
RowCount = 1
Set title = .document.getElementsByName("title=")
If Not title = "" Then
sht.Range("M" & RowCount) = title.Item(0).Value
End If
RowCount = RowCount + 1
'Set sht = Sheets("Sheet2")
RowCount = 1
For Each ele In .document.all
sht.Range("H" & RowCount) = ele.tagname
sht.Range("I" & RowCount) = ele.classname
sht.Range("J" & RowCount) = ele.ID
sht.Range("K" & RowCount) = ele.innerText
RowCount = RowCount + 1
Next ele
RowCount = RowCount + 1
Next lRow
End With
Set objIE = Nothing
MsgBox "finished"
End Sub
Bookmarks