extract some info from facebook page

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

extract some info from facebook page

by worthlessprogrammer on Wed Jan 25, 2017 10:28 am

Hi, a pictures says more then a thousand words. :-) Right click and save if you can't see the whole image.
Image

Build 9030808
Mac OSX Sierra
Firefox 50.1

Never programmed in imacros before but now I'm in the situation that I need to solve this task. :) Hope someone can help me out. It's probably not that complicated but to me it would take a lifetime to figure this out, have been trying the whole day on my own.
worthlessprogrammer
 
Posts: 2
Joined: Wed Jan 25, 2017 10:06 am

Re: extract some info from facebook page

by chivracq on Wed Jan 25, 2017 12:39 pm

worthlessprogrammer wrote:
Code: Select all
Build 9030808
Mac OSX Sierra
Firefox 50.1

Hi, a pictures says more then a thousand words. :-) Right click and save if you can't see the whole image.

http://hotspecialoffer.com/fbexample.png

Never programmed in imacros before but now I'm in the situation that I need to solve this task. :) Hope someone can help me out. It's probably not that complicated but to me it would take a lifetime to figure this out, have been trying the whole day on my own.

Euh..., yep, but what is the Pb...? :?

Simply record your Actions and add "EXTRACT=TXT"..., it works directly for me using all "Standard/Default" Record Options...:
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
URL GOTO=https://www.facebook.com/RoofExpertsSouthernCalifornia/?hc_ref=SEARCH&fref=nf
TAG POS=1 TYPE=A ATTR=TXT:Roofing<SP>Services<SP>of<SP>Southern<SP>California EXTRACT=TXT
PROMPT {{!EXTRACT}}
(Tested on iMacros for FF v8.8.2, Pale Moon v26.3.3 (=FF47), Win10-x64.)
- (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...
chivracq
 
Posts: 6481
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: extract some info from facebook page

by worthlessprogrammer on Thu Jan 26, 2017 4:11 am

It's not really correct the advice you gave me because the text changes. As I said in the first mail, it's gonna load a LIST of URL's from a .csv, open up every one of them in a new tab.

And then extract the text that shows up on the page. It's not gonna be Roofing<SP>Services<SP>of<SP>Southern<SP>California every time the page loads. Next URL it is going to be a different text there, so I want to able to extract the text in that location on the page.

And the second text I want to extract is the part that comes after in<SP> ie. city and state...

It might say roofer in Los Angeles, California
It might say restaurant in Bellingham, Washington

And the part I wanna extract is the part that comes after in<SP> = city and state.

Hope I made it a bit more clear now, I thought my image said more then a 1000 words, but sometimes words are more powerful. :-)
worthlessprogrammer
 
Posts: 2
Joined: Wed Jan 25, 2017 10:06 am

Re: extract some info from facebook page

by chivracq on Thu Jan 26, 2017 10:35 am

worthlessprogrammer wrote:It's not really correct the advice you gave me because the text changes. As I said in the first mail, it's gonna load a LIST of URL's from a .csv, open up every one of them in a new tab.

And then extract the text that shows up on the page. It's not gonna be Roofing<SP>Services<SP>of<SP>Southern<SP>California every time the page loads. Next URL it is going to be a different text there, so I want to able to extract the text in that location on the page.

And the second text I want to extract is the part that comes after in<SP> ie. city and state...

It might say roofer in Los Angeles, California
It might say restaurant in Bellingham, Washington

And the part I wanna extract is the part that comes after in<SP> = city and state.

Hope I made it a bit more clear now, I thought my image said more then a 1000 words, but sometimes words are more powerful. :-)

Oh yeah...!, you can better use "Standard" English on the Forum instead of this fake "wanna-gonna-wanna" Wannabee Chicago Kids Street Language, I'm a bit "allergic" to it...! :roll:

Well, "It's not really correct the advice you gave me", yep it is, with the Requirements that you provided in your OP which are:
- Find some Page on Internet on some "Facebook" Site about "Roofing Services of Southern California".
- Extract this "Roofing Services of Southern California" Text from the Field you indicated on your Screenshot.
And that's exactly what the Script I provided is doing. (I didn't handle the "save to .csv" part which shouldn't be a Pb...)

And I don't know what "mail" you are talking about...
That part I don't understand either: "And the second text I want to extract is the part that comes after in<SP> ie. city and state..."

But OK, new Requirement:
- Text is changing.

OK, then I would come up with the following Script:
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
TAB T=1
'URL GOTO=https://www.facebook.com/RoofExpertsSouthernCalifornia/?hc_ref=SEARCH&fref=nf
URL GOTO=https://www.facebook.com/RoofExpertsSouthernCalifornia/

'TAG POS=1 TYPE=A ATTR=TXT:Roofing<SP>Services<SP>of<SP>Southern<SP>California EXTRACT=TXT
TAG POS=1 TYPE=A ATTR=HREF:{{!URLCURRENT}} EXTRACT=TXT
PROMPT {{!EXTRACT}}
(Tested on iMacros for FF v8.8.2, PM v26.3.3, Win10-x64.)

You mention "a LIST of URL's from a .csv" but you don't post any URL('s), so I cannot test that part, ah-ah...!
The Script I provided works for the Info I've got... And it's just one Solution, there are probably 20 ways to do what you want...
- (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...
chivracq
 
Posts: 6481
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests

-->