How capture the members amount from a facebook group page?
Moderators: Dorian (MJT support), JRL
How capture the members amount from a facebook group page?
Hi,
I need to update the members number from a collection of 300 facebook groups pages. I have no problem displaying every group page, and I have tried to use text recognition commands without success, Could you please help to get that number?
Thank you,
Salvador
I need to update the members number from a collection of 300 facebook groups pages. I have no problem displaying every group page, and I have tried to use text recognition commands without success, Could you please help to get that number?
Thank you,
Salvador
Thanks,
Salvador Hernandez
Salvador Hernandez
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How capture the members amount from a facebook group pag
To get data from a web page I would not use text recognition. Use the IE functions to extract the data directly from the HTML element.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: How capture the members amount from a facebook group pag
Thanks for your answer, Could you give me one example of code of how to get the menber number from web page https://www.facebook.com/groups/CompraVentaMonterrey?
Thanks,
Salvador Hernandez
Salvador Hernandez
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How capture the members amount from a facebook group pag
If we inspect the element (right click on it and select "Inspect Element") in IE we see this:
So we want to extract the SPAN tag with id=count_text:
You need to make sure that IE is already open at the page for the above to work. For now, do that manually, but you could have the macro open it and log in if you need to first.
Now, this returns the result in allCounts_1. Of course it will contain:
"133,426 members"
If you just want the numeric value you could parse it out, something like:
Have a look at this article for more help in identifying elements:
http://help.mjtnet.com/article/13-findi ... -web-sites
So we want to extract the SPAN tag with id=count_text:
Code: Select all
IEGetTagsByAttrib>facebook.com/groups/CompraVentaMonterrey,SPAN,id=count_text,T,allCounts
Now, this returns the result in allCounts_1. Of course it will contain:
"133,426 members"
If you just want the numeric value you could parse it out, something like:
Code: Select all
StringReplace>allCounts_1,{","},,the_text
RegEx>\d*,the_text,0,matches,nm,0
MessageModal>matches_1
http://help.mjtnet.com/article/13-findi ... -web-sites
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: How capture the members amount from a facebook group pag
Thank you very much for your example. Is there a way to use meta characters, something like:
IEGetTagsByAttrib>facebook.com/groups/*,SPAN,id=count_text,T,allCounts
Thank you
IEGetTagsByAttrib>facebook.com/groups/*,SPAN,id=count_text,T,allCounts
Thank you
Thanks,
Salvador Hernandez
Salvador Hernandez
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How capture the members amount from a facebook group pag
It's already a substring match. So you just need:
IEGetTagsByAttrib>facebook.com/groups/,SPAN,id=count_text,T,allCounts
That would get it from the first IE instance it finds with "facebook.com/groups/" anywhere in the URL.
IEGetTagsByAttrib>facebook.com/groups/,SPAN,id=count_text,T,allCounts
That would get it from the first IE instance it finds with "facebook.com/groups/" anywhere in the URL.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: How capture the members amount from a facebook group pag
Thank you, I found a problem when a page is blocked, for example: https://www.facebook.com/groups/buenaventamt. I tried to fix it with the following code:
But I get error "No matching IE instance found" when a page is not blocked, Could you please help me?
Thank you
Code: Select all
IEGetTagsByAttrib>facebook.com/groups/,H2,Class=uiHeaderTitle,T,blockedPage
If>blockedPage_Number<>0
IEGetTagsByAttrib>facebook.com/groups/,SPAN,id=count_text,T,allCounts
StringReplace>allCounts_1,{","},,the_text
RegEx>\d*,the_text,0,matches,nm,0
Let>MembersNumber=matches_1
Else
Let>MembersNumber=0
EndIf
Thank you
Thanks,
Salvador Hernandez
Salvador Hernandez
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How capture the members amount from a facebook group pag
That tag doesn't exist when not blocked. You could extract the html from the containing element to check for existence, or, easier, just ignore any errors around this bit of code. Since you only want to do it when it's blocked anyway, that would be fine. Something like this:
Code: Select all
Let>MembersNumber=0
Let>IGNOREERRORS=1
IEGetTagsByAttrib>facebook.com/groups/,H2,Class=uiHeaderTitle,T,blockedPage
If>blockedPage_Number<>0
IEGetTagsByAttrib>facebook.com/groups/,SPAN,id=count_text,T,allCounts
StringReplace>allCounts_1,{","},,the_text
RegEx>\d*,the_text,0,matches,nm,0
Let>MembersNumber=matches_1
EndIf
Let>IGNOREERRORS=0
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: How capture the members amount from a facebook group pag
I want to improve the code assigning zero to the variable who saves the number of members, so the next time start with zero members, and if there is an error, it will return zero member, and I can detect easily an error. Is it correct the following code for that idea:
Code: Select all
Let>IGNOREERRORS=1
IEGetTagsByAttrib>facebook.com/groups/,H2,Class=uiHeaderTitle,T,blockedPage
If>blockedPage_Number<>0
IEGetTagsByAttrib>facebook.com/groups/,SPAN,id=count_text,T,allCounts
StringReplace>allCounts_1,{","},,the_text
RegEx>\d*,the_text,0,matches,nm,0
Let>MembersNumber=matches_1
'Clear matches_1, so next time if there is an error, MembersNumber will be zero, and I will detect it easily
Let>matches_1=0
EndIf
Let>IGNOREERRORS=0
Thanks,
Salvador Hernandez
Salvador Hernandez
Re: How capture the members amount from a facebook group pag
Marcus, what did you think about my previous post?
Thanks,
Salvador Hernandez
Salvador Hernandez
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How capture the members amount from a facebook group pag
You could do that. But I would simply set MembersNumber to zero before the check:
//If MembersNumber is zero here then we either got an error, or there are no members!
But also you can check to see if you got an error by checking LASTERROR. Please see Error Handling in help file.
Code: Select all
Let>MembersNumber=0
Let>IGNOREERRORS=1
IEGetTagsByAttrib>facebook.com/groups/,H2,Class=uiHeaderTitle,T,blockedPage
If>blockedPage_Number<>0
IEGetTagsByAttrib>facebook.com/groups/,SPAN,id=count_text,T,allCounts
StringReplace>allCounts_1,{","},,the_text
RegEx>\d*,the_text,0,matches,nm,0
Let>MembersNumber=matches_1
EndIf
Let>IGNOREERRORS=0
But also you can check to see if you got an error by checking LASTERROR. Please see Error Handling in help file.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: How capture the members amount from a facebook group pag
Marcus,
Hi, I need your help, please, The macro to get the members number of every groups link was working for months, but sudenly failed. I created a video, you can watch it on the following link https://youtu.be/Dvadgtw6Qhc. Cold you please help me to fix it?
Thanks,
Salvador
Hi, I need your help, please, The macro to get the members number of every groups link was working for months, but sudenly failed. I created a video, you can watch it on the following link https://youtu.be/Dvadgtw6Qhc. Cold you please help me to fix it?
Thanks,
Salvador
Thanks,
Salvador Hernandez
Salvador Hernandez
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: How capture the members amount from a facebook group pag
It's quite probable the code on the page has changed. This could cause it to fail. Have you tried running through the same steps you already performed to create this originally? I'd be very surprised if that didn't fix it.
Yes, we have a Custom Scripting Service. Message me or go here