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
Add the ability to generate web pages #6
Comments
@killlowkey I thought of that method but there were some images which doesn't show up in HTML. This is why I had to take screenshot of each webpage. I would suggest you to use educative-viewer to view the scraped courses as it is also designed for mobile view. |
@anilabhadatta I might have a solution to this problem by trying to convert the image to Base64 encoding, as shown below |
@killlowkey try to implement it |
thank you |
Hi Killlowkey, any progress on saving webpage as html or mhtml ?? @anilabhadatta can you please try saving the webpage as .mhtml instead of taking screenshot?? would be really helpful. |
@BoostUpStation I don’t found now. Image not be show if use browser saved webpage to html or mhtml. |
here's an old repo which saves in html/mhtml and pdf, but in typescript, don't know that :( hoping somebody can implement it here in Python :) |
@BoostUpStation I never use python and ts, so I don’t help you. I think key idea for save webpage to html or mhtml is convert image url to base64 encoding. Hope it helps you. |
@BoostUpStation @killlowkey Mainly there are few svg tags which contain image URLs , so the main option is to find every image URL and convert to base64 and also keep a track of image tags inside svg's and show them up in mhtml. test URL where you can see the image wont show up in mhtml. |
@anilabhadatta I can't test the URL currently because I don't have an Educative Pro account. You may be able to find an unlimited URL, let me see the effect |
@killlowkey i will try to send a free course link having the same issue. |
@anilabhadatta This is a tricky problem, I currently have no way to display SVG in mhtml. |
@killlowkey yes, that is why i didn't implement it. Try, if you can find a way to show the SVG image element in mhtml. |
@anilabhadatta Now have to add these steps through scripting in python/js/html, so please do this. Rather than converting, decoding and encoding stuffs. |
@BoostUpStation actually if you ctrl+s mhtml then you wont be able to see the image present inside a iframe > SVG |
@anilabhadatta yes you are right, So base64 is the only way then apart from image. Pls see that past repo link i shared, he also took screenshot ig with some more implementation(typescript was used.), and in that even if we zoom more than 400%, quality remains the same and pixels doesn't tear apart. |
@anilabhadatta here's some python code which will convert image to base64 and vice versa And the link to thosa svg's can be easily taken via js. |
@BoostUpStation the issue is not with finding base64 or conversion. |
@killlowkey @BoostUpStation New update. ifrm = document.querySelectorAll("object[aria-label='svg viewer']")[0] Try this in your system chrome console and then save the file using SingleFile. |
@anilabhadatta |
@killlowkey i will test this after few hours gildas-lormeau/SingleFile#820 |
@anilabhadatta |
@anilabhadatta ifrm = document.querySelectorAll("object[aria-label='svg viewer']")[0] https://www.educative.io/courses/getting-started-braintree-api/x1BG30wrnol Uncaught TypeError: Cannot read properties of undefined (reading 'contentDocument') |
So here we have to check if webpage has 'contentDocument' element or not. |
@anilabhadatta you can do like this if it can work. And then run that above 4 5 lines script, |
I will have to see the singlefile injection part. |
@BoostUpStation @killlowkey implementation successfully completed. |
@anilabhadatta It works perfectly. Nice. |
@killlowkey @BoostUpStation will do some testing and then I will push it. |
@anilabhadatta awesome. You add the code, i'll refork it. Waiting for code updation from your side. And will the codes inside html be scrollable or still separate code files must be used to view the code? |
@BoostUpStation code will not be scrollable because that is done dynamically from educative servers. I will recommend you to use educative-viewer to open code window and easier access to HTML files as well. |
@killlowkey @BoostUpStation i have pushed the latest version, clone it and test it for few courses. |
@killlowkey @BoostUpStation Refer v5.2 latest commit pushed few minutes ago |
@anilabhadatta yes, i have pulled latest code, and testing it. And what about when we have scraped courses, why would we scrape the same course when using the scraper for paths? |
@BoostUpStation i tried local injection but failed so i am pulling it from git. (If you are able to implement it then you can commit it ) |
@BoostUpStation I have updated educative-viewer as well. Will show content in 100% zoom |
@anilabhadatta so is it better to scrape single single courses or paths? |
@BoostUpStation basically the scraper needs the first topic url and index(for resume) |
@BoostUpStation if you want to check if the course if already downloaded so you don't want to scrape it again while scraping paths then you will need to manually remove those urls. |
@anilabhadatta ok thanks, i'll try that in a few days. |
@BoostUpStation codewidget may or maynot contain codes |
@BoostUpStation fixed and added a feature to collect data from runjs type containers. |
@anilabhadatta |
@anilabhadatta |
@BoostUpStation the whole code wont be available if the widget has a scroller |
@anilabhadatta |
Ya, but if it doesn't have scroller, then in that case it is more helpful and i have implemented it, if you allow?, i can create a pull request for just that. |
@BoostUpStation create a pr then. |
@anilabhadatta 1 issue when saving the single file. |
@BoostUpStation nothing can be done because i have to take screenshots of quiz and they are non selectable for that reason and let it repeat the 1st question, there maybe cases where the first question may not show in single file |
@anilabhadatta the page is not responsive, please do something about it. |
@BoostUpStation which images? |
@anilabhadatta |
@BoostUpStation ooh okay, the only issue you may face is the code containers in html going out of screen in educative viewer. That is a css issue, see if you fix it. |
@BoostUpStation @killlowkey I am closing this issue as it is now fixed, if there is any bugs, create a new issue. |
Hello, thank you for creating an excellent project, it is very helpful to me.
I have an idea. You can add the ability to generate pages with links similar to those below, Generating images is not conducive to reading.
url-shortening-service-like-tiny-url
Thank you very much.
The text was updated successfully, but these errors were encountered: