Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant set cookies #1124

Open
rakage opened this issue Nov 14, 2024 · 0 comments
Open

cant set cookies #1124

rakage opened this issue Nov 14, 2024 · 0 comments

Comments

@rakage
Copy link

rakage commented Nov 14, 2024

Hi, i have a cookie that extracted from CookieManager, but i got error
Requesting page from: https://m.facebook.com/pfbid037tBZ7KYfHSacfqGdbmK6tXu78RUYHp2L31K4A9rCcewHNL53ERSuEaFkDJZFuwjFl
No raw posts (

elements) were found in this page.
Error scraping comments for https://www.facebook.com/photo.php?fbid=950799983744725&set=pb.100064441971374.-2207520000&type=3: 'time'

"
try:
set_noscript(True)
set_cookies('exported-cookies.json')
enable_logging()
data = get_posts(
# post_urls=[bank_url],
post_urls=['pfbid037tBZ7KYfHSacfqGdbmK6tXu78RUYHp2L31K4A9rCcewHNL53ERSuEaFkDJZFuwjFl'],
options={"comments": 10000, "progress": True},
# cookies='exported-cookies.json'
)
post = next(data)
post_date = post['time']
comments = post['comments_full']
komen = []
balasan = []
for comment in comments:
if len(comment['replies']) > 0:
for reply in comment['replies']:
balasan.append({
'url': bank_url,
'post_date': post_date,
'name': reply['commenter_name'],
'comments': reply['comment_text'],
'comments_date': reply['comment_time'],
'bank': bank_name,
'platform': 'Facebook'
})
else:
komen.append({
'url': bank_url,
'post_date': post_date,
'name': comment['commenter_name'],
'comments': comment['comment_text'],
'comments_date': comment['comment_time'],
'bank': bank_name,
'platform': 'Facebook'
})

    data_comments.extend(komen)
    data_comments.extend(balasan)
    # time.sleep(5)
except Exception as e:
    print(f"Error scraping comments for {bank_url}: {e}")

"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant