Xincha1212 / facebook_crawler

facebook新手爬虫小项目~
0 stars 0 forks source link

iss #1

Open anhvietnx opened 1 year ago

anhvietnx commented 1 year ago

it run on window or ubuntu? it can download comment and post from page?

Xincha1212 commented 1 year ago

您好!      chai已收到您的邮件。

Xincha1212 commented 1 year ago

windows. I have not added the function of download any message, but it will print the message on your console.  I was very busy recently, I expect to add other features like downloads in a month.

---Original--- From: @.> Date: Mon, Jun 12, 2023 16:46 PM To: @.>; Cc: @.***>; Subject: [Xincha1212/facebook_crawler] iss (Issue #1)

it run on window or ubuntu? it can download comment and post from page?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

anhvietnx commented 1 year ago

today i use part : Invidual_post , then i change :

  1. Line 17 and 18 username.send_keys("anhvietnx") password.send_keys("") // i chang to my pass
  2. Line 177 : url = 'https://www.facebook.com/anhvietnx/' Then i run code , so i only take one post (the last post on the facebook ) . It is : 第1个帖子的内容为:

Ghet cho Luong vcl aaaaaaa Noi xong lai phai lay nick phu mo vao xem nick face ny , dme nhu cc

then it is error : i take screenshort for this on google driver, this link : https://shorturl.at/cvwM1 Hope u reply. Wish you have lots of health and success in your life !

Xincha1212 commented 1 year ago

Well, thank you for your letter. I think I found the problem. You crawled the user's first post does not have the element of the number of likes, but it has the element of the number of expressions, whose css's path is different from the element of the number of likes. You can check it through my screenshot, which is the attachment. Therefore, python will report the error.  The solution is you are supposed to replace the correct css's path of the number of expressions, or delete the function of crawl the number of likes. I am sorry that my English is very poor. There may have been misunderstandings of expression. Best wishes! ------------------ 原始邮件 ------------------ 发件人: "Xincha1212/facebook_crawler" @.>; 发送时间: 2023年6月14日(星期三) 晚上8:38 @.>; @.**@.>; 主题: Re: [Xincha1212/facebook_crawler] iss (Issue #1)

today i use part : Invidual_post , then i change :

Line 17 and 18 username.send_keys("anhvietnx") password.send_keys("") // i chang to my pass

Line 177 : url = 'https://www.facebook.com/anhvietnx/' Then i run code , so i only take one post (the last post on the facebook ) . It is : 第1个帖子的内容为:

Ghet cho Luong vcl aaaaaaa Noi xong lai phai lay nick phu mo vao xem nick face ny , dme nhu cc

then it is error : i take screenshort for this on this link : Hope u reply. Wish you have lots of health and success in your life !

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

anhvietnx commented 1 year ago

yes , i understand what you said , I think i accept that code have : delete the function of crawl the number of likes . Because i only want to see the content of post , i don't care about the likes or emotion or cmt v.v i have fix it with your opinion, tks !

anhvietnx commented 1 year ago

more issue that i see the def : def enter_target():

模拟登录

driver.implicitly_wait(20)
username = driver.find_element(By.CSS_SELECTOR, value=r'div[class = "xod5an3"] > div > label > div > div > input')
password = driver.find_element(By.CSS_SELECTOR, value=r'div[class = "x1c436fg"] > div > label > div > div > input')
username.send_keys("anhvietnx")
password.send_keys("")
password.send_keys(Keys.RETURN)
driver.implicitly_wait(20)
If I don't give the usename and pass , this code still run correctly?
anhvietnx commented 1 year ago

And the last issue , can i have crawl post from many page or person , in the line 170 and 171 if name == "main": i think this code is only deal with one person or one page Hope u reply !