So far the code opens our code goes to a patent website that uses javascript, inserts the desired record in the search box, executes the search and opens the legal status in a new window with only an address bar (not sure how it's called).
The problem is, this window is not active, and we cannot manipulate this window. Our goal is to gain the information that shows up in the popup window and export it to our excel sheet.
So the question is: How do we focus on this new window and what would be best practice to export this all to excel? Thanks in advance.
Sub internetform()
Dim IE As Object
Dim hWND As Long
Dim IEpopup As Object
'Dim doc As HTMLDocument
Dim pubno As String
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://www.pss-system.gov.cn/sipopublicsearch/inportal/i18nAC.do?request_locale=en_US"
IE.Visible = True
While IE.Busy
DoEvents
Wend
pubno = ThisWorkbook.Sheets("Sheet1").Range("A1")
Application.Wait (Now() + TimeValue("00:00:02"))
IE.Document.All("searchInfo0").Value = pubno
While IE.Busy
DoEvents
Wend
IE.Document.All("executeSearch0").Click
Application.Wait (Now() + TimeValue("00:00:14"))
IE.Navigate "javascript:showAssisantTools_insearch('" & pubno & "','" & pubno & "',2)"
'FindWindow(vbNullString, pubno)
Application.Wait (Now() + TimeValue("00:00:02"))
'exporting div in body to excel
IE.Navigate "www.google.nl"
IE.Document.All("q").Value = pubno
Debug.Print IE.Document.All("bodyMid rop")
End Sub