hardeepnarang10 / fb2ics

Scan saved facebook page for birthday information to generate importable ICS (calendar) file.
MIT License
24 stars 7 forks source link

Scrapper Issue #6

Closed rosnshah closed 4 years ago

rosnshah commented 5 years ago

Here is a traceback

Executing fb2ics...
Traceback (most recent call last):
  File "fb2ics.py", line 122, in <module>
    main()
  File "fb2ics.py", line 56, in main
    scrape_list = scraper.collective_scraper(scrape_line)
  File "C:\Users\hp\Desktop\bday resore\fb2ics-master\include\scraper.py", line 30, in collective_scraper
    name_day_list = name_day_scraper(raw_scrape_list)
  File "C:\Users\hp\Desktop\bday resore\fb2ics-master\include\scraper.py", line 52, in name_day_scraper
    if (name + get_bday(date)) not in bday_list:
  File "C:\Users\hp\Desktop\bday resore\fb2ics-master\include\scraper.py", line 60, in get_bday
    if (WEEKDAYS.index(day_of_the_week) <= present_day):
ValueError: tuple.index(x): x not in tuple
Press any key to exit.
hardeepnarang10 commented 5 years ago

Issue fixed. Commit (12172aa).

Description: Friend list may contain nicknames. Since nicknames contain brackets which both scraper.py and parser.py rely upon for processing, it is not correctable. However, I've added functionality to identify nicknames and log them to a file. Also, data which does not match any known description now identifies as 'bad input'.

Thanks for reporting @rosnshah

rosnshah commented 5 years ago

Approx how much time does it take to process on an 8GB RAM machine with around ~1k friends?

rosnshah commented 5 years ago

It has been more than 10 mins and it's yet to return any output

rosnshah commented 5 years ago

For my file, the code isn't entering this section of code

try:
        if not scrape_line:
            raise ValueError('Invalid input. ' + filename + ' does not contain birthday info.', INSTRUCTION_STRING)
    except ValueError as valerr:
        print('\n' + valerr.args[0] + '\n' + valerr.args[1])
        exit(-12)
hardeepnarang10 commented 5 years ago

This doesn't seem right. Please clone the latest commit and retry. Also, in your reference, reduce indentation from 8 whitespaces to 4 after try block.

So this:

try:
        if not scrape_line:
            raise ValueError('Invalid input. ' + filename + ' does not contain birthday info.', INSTRUCTION_STRING)
    except ValueError as valerr:
        print('\n' + valerr.args[0] + '\n' + valerr.args[1])
        exit(-12)

becomes:

try:
    if not scrape_line:
        raise ValueError('Invalid input. ' + filename + ' does not contain birthday info.', INSTRUCTION_STRING)
except ValueError as valerr:
    print('\n' + valerr.args[0] + '\n' + valerr.args[1])
    exit(-12)

I'm travelling at the moment so I might not be available for the time being. Rest assured I'll perform more tests to root out this issue.

rosnshah commented 5 years ago

I have ~1k friends, but the output file only has 8 birthdays and the missed_entries.log just shows one entry as Money Heist (subbed) Can you look into it, what's wrong with it

hardeepnarang10 commented 5 years ago

@rosnshah It seems the problem is on your end of operation. The output you describe is only generated when the webpage passed isn't complete.

Please read instructions carefully. Remember to scroll down to end of the web page before saving.

If problem still persists, send me saved HTML file.

Remark: Apparent client-side issue. Pending closure.

rosnshah commented 4 years ago

Hey, Yes the problem got solved as I changed the browser to save the page. Thanks a lot! :)