Coder Social home page Coder Social logo

Comments (12)

anilabhadatta avatar anilabhadatta commented on June 6, 2024 1

@sumant4ssm thank you for pointing out the issue.
Currently i am not well so i will try to fix it in few days.
If possible comment the latest get file name function and uncomment the previous one present just above.

from educative.io_scraper.

anilabhadatta avatar anilabhadatta commented on June 6, 2024 1

@paletikoushik In my testing, i am not receiving this error.
Please answer the following?
Have you created a virtual env?
If yes, then did you install the modules from requirements.txt in your virtual env?

In my tool, I am using python-slugify instead of slugify. Maybe that is causing some issues.

One more note I should add, there is a bug in file naming as well. I will fix it today.

from educative.io_scraper.

paletikoushik avatar paletikoushik commented on June 6, 2024 1

running the commands with
python chromedriver.py
python educative_scraper.py instead of python3 chromedriver.py..... solved my issue it asked for selenium and slugify and i used python-slugify it worked like charm thanks for the scraper and many many thanks for your support.

from educative.io_scraper.

sumant4ssm avatar sumant4ssm commented on June 6, 2024

Hi @anilabhadatta , I am having the same issue, how do we fix it?

image

from educative.io_scraper.

sumant4ssm avatar sumant4ssm commented on June 6, 2024

Alright, I am not a Python expert but I debugged this problem and found the problem was with the below code

    print("Getting File Name")
    meta_script_selector = "script[type='application/ld+json']"
    metadata = driver.find_elements( By.CSS_SELECTOR, meta_script_selector)[0].get_attribute('innerHTML')
    metadata = json.loads(metadata)
    if course_folder:
        file_name = metadata['name']

Just note this line
metadata = driver.find_elements( By.CSS_SELECTOR, meta_script_selector)[0].get_attribute('innerHTML')
It uses the 0th element but in my case, it was 1st element( Found out after looking through the sources)

Changing the previous line to the below line fixes the problem

metadata = driver.find_elements( By.CSS_SELECTOR, meta_script_selector)[1].get_attribute('innerHTML')

I am not sure it's always one, but the one solution I could think of is to look through all the array elements if there is no name found.

by the way, @anilabhadatta , Thank you for this tool.

from educative.io_scraper.

sumant4ssm avatar sumant4ssm commented on June 6, 2024

thanks @anilabhadatta . It was an easy fix and was able to fix it.

from educative.io_scraper.

paletikoushik avatar paletikoushik commented on June 6, 2024

@sumant4ssm thank you for pointing out the issue. Currently i am not well so i will try to fix it in few days. If possible comment the latest get file name function and uncomment the previous one present just above.

after commenting getting below error any help is greatly appreciated

ad Webpage Function
Checking Login Function
Checking for captcha Function...
Create Course Folder Function
Getting File Name
File Name Found
Found Issue, Going Next Course slugify() got an unexpected keyword argument 'replacements'
Script Execution Complete

from educative.io_scraper.

anilabhadatta avatar anilabhadatta commented on June 6, 2024

@zerohope @sumant4ssm @paletikoushik Test it now, should be fixed. Clone the repo again in a fresh location.

from educative.io_scraper.

paletikoushik avatar paletikoushik commented on June 6, 2024

cloned the repo again in fresh location still getting below error, any help is greatly appreciated sir.

Driver Loaded

                        [Selected config: 0] Starting Scraping: 0, https://www.educative.io/courses/decode-coding-interview-cpp/qABQKQqWmmk

Load Webpage Function
Checking Login Function
Checking for captcha Function...
Create Course Folder Function
Getting File Name
File Name Found
Found Issue, Going Next Course slugify() got an unexpected keyword argument 'replacements'

from educative.io_scraper.

paletikoushik avatar paletikoushik commented on June 6, 2024

Ok sir, so I made mistake

after install requirements.txt I got selenium missing.
I did pip3 install selenium and after that got slugify missing and I used pip3 install slugify, so that is creating the problem sir now how to solve this issue sir. I tried to uninstall it by pip3 uninstall slugify and installing pip3 install python-slugify still getting same error. I tested it on mac and its working fine (as that was first time i got same error like selenium missing and slugify missing and I installed pip3 install python-slugify and its working. What should I do on my windows laptop any help is greatly appreciated.

from educative.io_scraper.

anilabhadatta avatar anilabhadatta commented on June 6, 2024

@paletikoushik can you share your screen? Send me a meet link and ping me up

from educative.io_scraper.

anilabhadatta avatar anilabhadatta commented on June 6, 2024

Welcome.

from educative.io_scraper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.