I feel like there should be a more efficient way of doing this. There is so much shit going on in the FB source compared to normal websites that I am used to working with. For 1, none of the classes for each post seem to be the same, but I might be missing something. Also, there is a lot of JS and other crap that BS is trying to grab from each post.
I am trying to:
1) Grab a plain-text post from another page
2) Post it on my page
Is there a more efficient way of doing this? Thanks.
Probably not due to Facebook being dynamic.
Logging into Facebook will be no hassle, but the scraping part will.
Even though I don't like it, the only thing I can reconmend is selenium because it can load the HTML via the JavaScript.
DO NOT DEAL WITH THIS MEMBER
Mar 27, 2017 04:24 AM
(This post was last modified: Mar 27, 2017 04:27 AM by SIM-1866423.)
Did you try facebook API ?
(Mar 27, 2017 03:18 AM)hunter24957 Wrote: Probably not due to Facebook being dynamic.
Logging into Facebook will be no hassle, but the scraping part will.
Even though I don't like it, the only thing I can reconmend is selenium because it can load the HTML via the JavaScript.
Can you login to Facebook using Requests? I tried to do it for an old project, but couldnt get it to work, so I had to go with Selenium... :/
DO NOT DEAL WITH THIS MEMBER
(Mar 27, 2017 04:26 AM)Molino. Wrote: Can you login to Facebook using Requests? I tried to do it for an old project, but couldnt get it to work, so I had to go with Selenium... :/
Yes u can, did it couple week before for medium level project.
(Mar 27, 2017 04:26 AM)Molino. Wrote: Can you login to Facebook using Requests? I tried to do it for an old project, but couldnt get it to work, so I had to go with Selenium... :/
Yes, it's pretty simple actually.
(Mar 27, 2017 04:29 AM)hunter24957 Wrote: Yes, it's pretty simple actually.
Hmm, will have to try again then. I'm pretty sure I messed up on the form sent, as I i think i missed some fields on the request...
(Mar 27, 2017 04:33 AM)Molino. Wrote: Hmm, will have to try again then. I'm pretty sure I messed up on the form sent, as I i think i missed some fields on the request...
Try using TamperData and LiveHTTPHeaders it will show you what data is being sent and requested.
(Mar 27, 2017 04:41 AM)hunter24957 Wrote: Try using TamperData and LiveHTTPHeaders it will show you what data is being sent and requested.
I know, but I think the info for the form changes (this is based on what I found online, not sure). You have to GET the Login page first, and then parse the HTML to get the info for the Login Form first, then also add the email and password to the form.
If I'm wrong, please do correct me, has it would make it much easier.
(Mar 27, 2017 04:44 AM)Molino. Wrote: I know, but I think the info for the form changes (this is based on what I found online, not sure). You have to GET the Login page first, and then parse the HTML to get the info for the Login Form first, then also add the email and password to the form.
If I'm wrong, please do correct me, has it would make it much easier.
It can differ from website to website, for Instagram you just send a post request with the correct data and you are logged in.
BTC - 15Cn2u7onAuPaMFGmT4qbEhWgzsKSvMEn6
ETH - 0x5198A50b164a14Df7eAB562da7b440197cb9808B
![[Image: folks.gif]](https://gfxf.net/images/2017/04/17/folks.gif)
(Mar 27, 2017 08:15 AM)Folks Wrote: It can differ from website to website, for Instagram you just send a post request with the correct data and you are logged in.
Yes, I understand that. I'm going to give it another try then. If I fail, I'll just create a thread about it...
|