Cannot Extract Emails Created

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
daxam
Posts: 13
Joined: Wed Mar 28, 2018 6:49 am

Cannot Extract Emails Created

Post by daxam » Wed Mar 28, 2018 7:19 am

Config Info
Firefox 56.0.2
imacros 8.9.7
windows 7 Pro

I've been trying to scrape the emails from email provider, gmx for the past 2 days. Couldn't get it to save into csv file. Nothing was saved actually :cry: Here's my simple code

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
FRAME NAME="mail"
TAG POS=1 TYPE=DIV ATTR=CLASS:table_field<SP>table_col-12&&ID:id240 EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=debug.csv


The thing that troubles me is I can actually see the email is extracted from the pop up message box. See attached image. Is there something wrong with my code? Searched the forum and google, couldn't find what's wrong with the code :cry:
Pop Up Msg.JPG
Pop Up Message
chivracq
Posts: 8535
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Cannot Extract Emails Created

Post by chivracq » Wed Mar 28, 2018 2:36 pm

daxam wrote:Config Info

Code: Select all

Firefox 56.0.2
imacros 8.9.7
windows 7 Pro
I've been trying to scrape the emails from email provider, gmx for the past 2 days. Couldn't get it to save into csv file. Nothing was saved actually :cry: Here's my simple code

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
FRAME NAME="mail"
TAG POS=1 TYPE=DIV ATTR=CLASS:table_field<SP>table_col-12&&ID:id240 EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=debug.csv
[/color]

The thing that troubles me is I can actually see the email is extracted from the pop up message box. See attached image. Is there something wrong with my code? Searched the forum and google, couldn't find what's wrong with the code :cry:
Pop Up Msg.JPG
Looks like the Extract contains some (soft) Tabs and/or Returns that either generate a "very big" Cell that might fall outside of your Screen, when opening your '.CSV' from Excel/OO or maybe even with the E-mail Data landing into some far Cell in some Col on the Right outside of your Screen if you selected 'Tab' (or maybe even 'Space') as Separator in the '.CSV' Import Options in Excel...

Check by opening your '.CSV' with 'Notepad' that the extracted Data is indeed present in the 'SAVEAS'...

=> Then you would need to use 'EVAL()' to "clean up" a bit all those (Soft) Tabs/Returns from the Extract..., and I guess you don't need the "(Default sender address)" either in your 'SAVEAS'...
It might then be "easier" to clean the Data from 'EXTRACT=HTM' instead of your 'EXTRACT=TXT'. :idea:
... Or that 'DIV' might contain some other inner 'DIV'/'SPAN' Field(s) for which 'EXTRACT=TXT' might give directly a "cleaner" Content...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
daxam
Posts: 13
Joined: Wed Mar 28, 2018 6:49 am

Re: Cannot Extract Emails Created

Post by daxam » Wed Mar 28, 2018 3:59 pm

Thanks for your reply, chivracq. You are my savior! :D I only noticed what's going on after using Notepad to open the csv file. The data is there all the time, but was hiding in Excel cell. I have to press "F2" to see the data. See image below. Oh man, I spent 2 days debugging this! :oops:

Thanks so much for the help, chivracq :D
csv file.JPG
Excel csv
chivracq
Posts: 8535
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Cannot Extract Emails Created

Post by chivracq » Wed Mar 28, 2018 4:34 pm

daxam wrote:Thanks for your reply, chivracq. You are my savior! :D I only noticed what's going on after using Notepad to open the csv file. The data is there all the time, but was hiding in Excel cell. I have to press "F2" to see the data. See image below. Oh man, I spent 2 days debugging this! :oops:

Thanks so much for the help, chivracq :D
csv file.JPG
Yep..., that's indeed what I "suspected", ah-ah...! :wink:

Cleaning up your Extract would still be "a good Idea", I would think, like for example:

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
FRAME NAME="mail"
TAG POS=1 TYPE=DIV ATTR=CLASS:table_field<SP>table_col-12&&ID:id240 EXTRACT=TXT
SET Email EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('('); y=x[0]; z=y.trim(); z;")
SET !EXTRACT {{Email}}
SAVEAS TYPE=EXTRACT FOLDER=* FILE=debug.csv
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
daxam
Posts: 13
Joined: Wed Mar 28, 2018 6:49 am

Re: Cannot Extract Emails Created

Post by daxam » Sun Apr 01, 2018 10:30 am

chivracq wrote:
daxam wrote:Thanks for your reply, chivracq. You are my savior! :D I only noticed what's going on after using Notepad to open the csv file. The data is there all the time, but was hiding in Excel cell. I have to press "F2" to see the data. See image below. Oh man, I spent 2 days debugging this! :oops:

Thanks so much for the help, chivracq :D
csv file.JPG
Yep..., that's indeed what I "suspected", ah-ah...! :wink:


Cleaning up your Extract would still be "a good Idea", I would think, like for example:

Code: Select all

VERSION BUILD=8970419 RECORDER=FX
TAB T=1
FRAME NAME="mail"
TAG POS=1 TYPE=DIV ATTR=CLASS:table_field<SP>table_col-12&&ID:id240 EXTRACT=TXT
SET Email EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('('); y=x[0]; z=y.trim(); z;")
SET !EXTRACT {{Email}}
SAVEAS TYPE=EXTRACT FOLDER=* FILE=debug.csv
Sorry for the late reply. Was on business trip. Wow, thanks for the guidance in cleaning up the extract! Thanks so much, chivracq :D
chivracq
Posts: 8535
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Cannot Extract Emails Created

Post by chivracq » Sun Apr 01, 2018 12:29 pm

daxam wrote:Sorry for the late reply. Was on business trip. Wow, thanks for the guidance in cleaning up the extract! Thanks so much, chivracq :D
Ah-ah...!, don't worry, always glad to help... :D
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply