Using exact same method as other site, I cannot even get started, ie picking up the username input just fails. Wondering what is special here... could it be OAUTH? I know nothing about that... but saw it mentioned elsewhere. I have no idea even how to tell if this site uses some such authentication... any suggestions?
If I should open this in another thread.. let me know ;-)
I already have thought of that .. but is it the same as chrome driver ..?
Is there a way to deal with just one page while using selenium and ignore other tabs .. this is because when trying to run a code there are other tabs opened (advertisements) and I want to make the desired tab active all the time
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cellv As Integer
cellv = Cells(2, 7).Value
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
Do While IE.Busy Or _
IE.readyState <> 4
Dim rowElements As Object, rowElement As Object, columnElement As Object
Set rowElements = IE.document.getElementsByClassName("figureTable")(1).getElementsByTagName("tr")
i = 3
For Each rowElement In rowElements
j = 1
For Each columnElement In rowElement.getElementsByTagName("td")
Cells(i, j).Value = columnElement.innerText
j = j + 1
i = i + 1
Set IE = Nothing
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Thank you. Modified to create TMP folder on the desktop without knowing the path. Posting here for others, should the need arise.
Dim newTmp As String
newTmp = CreateObject("WScript.Shell").SpecialFolders("Desktop")
If Not CreateObject("Scripting.FileSystemObject").FolderExists(newTmp & "\tmp") Then
CreateObject("Scripting.FileSystemObject").CreateFolder (newTmp & "\tmp")
If sessionId expires in a day or after few hours then you have to make one request for accepting the terms which sends jsessionId in cookie. Then you have to parse it using http.getAllResponseheaders() method and use it in further POST requests as mentioned.
Am reviewing these instructions to resolve the jsessionid cookie.
Any supportive links for instruction in this, greatly appreciated.
This one doesn't give any error. The css selector was faulty.
Dim driver As New WebDriver
Dim posts As Object, post As Object
driver.Start "Phantomjs", "https://redmart.com"
Set posts = driver.FindElementsByCss("li.productPreview")
For Each post In posts
i = i + 1: Cells(i, 1) = post.FindElementByCss("h4 > a").Text
Cells(i, 2) = post.FindElementByCss("span[class^=ProductPrice]").Text
Cells(i, 3) = post.FindElementByCss("img.showImage").Attribute("src")
@ranjithkumar10 I incorporated the code into my existing code. I am getting a compile error, method ir data member not found. It is reacting to the items as outlook.items line. Here is the code I am testing.
Private WithEvents Items As Outlook.Items
Private Sub Application_Startup()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Set objNS = olApp.GetNamespace("MAPI")
Set Items = Outlook.Item
Set Item = Outlook.MailItem
singlefolder As Outlook.Folder
testfolders As Outlook.Folder
Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
Private Sub Items_ItemAdd(ByVal Item As Object)
On Error GoTo ErrorHandler
'Only act if it's a MailItem
Dim Msg As Outlook.MailItem
If TypeName(Item) = "MailItem" Then
Set Msg = Item
'Set folder to save in.
Dim destfldr As Outlook.Folder
destfoldrId As String
Set Items = objNS.GetDefaultFolder(olFolderInbox).Item
Set Item = Items.GetFirst
destfoldrId = getfolderId("customfolder")
Dim myAttachments As Outlook.Attachments
'location to save in. Can be root drive or mapped network drive.
Const attPath As String = "T:\Daily Report Raw Data"
Const attPath2 As String = "T:\Programmatic Deal Raw Data"
'Change variables to match need. Comment or delete any part unnecessary.
If (Msg.SenderEmailAddress = "[email protected]") And _
(Msg.Subject = "Last 7 Day House Ads") And _
(Msg.Attachments.Count >= 1) Then
Set myAttachments = Item.Attachments
myAttachments.Item(1).SaveAsFile attPath & "\Daily House Ads.xls"
'mark as read
Msg.UnRead = False
Set destfldr = objNS.GetFolderFromID("DFPHouse")
Hi @elfrom I tried this but there's an issue with the library which is throwing an error out of stack space if nested levels are more than 3. I'll keep trying to find any workaround and let you know if I find something. And yes this is one complicated recursion!
Looks like your connection to Codingislove Forum was lost, please wait while we try to reconnect.