rajatomar788 / pywebcopy

Locally saves webpages to your hard disk with images, css, js & links as is.
https://rajatomar788.github.io/pywebcopy/
Other
531 stars 106 forks source link

ValueError: path is on mount 'L:', start on mount 'C:' #14

Closed KhairiAnuar closed 5 years ago

KhairiAnuar commented 5 years ago

I am getting this error, Any idea why?

Code is just this on scrap.py

from pywebcopy import save_webpage
kwargs = {
    'project_folder': '/assets/saved_webPages',
    'project_name': 'localhost'
}
url = 'https://en.wikipedia.org/wiki/EndNote'
save_webpage(
    url=url,
    **kwargs
)

Error Logs C:\xampp\htdocs\project\venv\Scripts\python.exe C:/xampp/htdocs/project/scrap.py config - INFO - Got response <Response [200]> from https://en.wikipedia.org/robots.txt config - INFO - Got response <Response [200]> from https://en.wikipedia.org/wiki/EndNote webpage - INFO - Starting save_complete Action on url: ['https://en.wikipedia.org/wiki/EndNote'] parsers - INFO - Parsing tree with source: <<urllib3.response.HTTPResponse object at 0x03617850>> encoding and parser <<lxml.etree.HTMLParser object at 0x035BEC30>> Traceback (most recent call last): File "C:/xampp/htdocs/project/scrap.py", line 21, in **kwargs File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\api.py", line 88, in save_webpage wp.save_complete() File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\webpage.py", line 275, in save_complete self.parse() # call in the action File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\parsers.py", line 192, in parse o = factory(elem, attr, url, pos) File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\elements.py", line 456, in make_element rel_path = pathname2url(obj.relative_to(utx.file_path)) File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\urls.py", line 469, in relative_to rel_path = os.path.relpath(head, start) File "C:\Users\My Computer\AppData\Local\Programs\Python\Python37-32\lib\ntpath.py", line 562, in relpath path_drive, start_drive)) ValueError: path is on mount 'L:', start on mount 'C:'

Process finished with exit code 1

rajatomar788 commented 5 years ago

Project path must be an absolute address.

On Sat, Jun 22, 2019, 12:40 PM khairi notifications@github.com wrote:

I am getting this error, Any idea why?

Code is just this on scrap.py

from pywebcopy import save_webpage kwargs = { 'project_folder': '/assets/saved_webPages', 'project_name': 'localhost' } url = 'https://en.wikipedia.org/wiki/EndNote' save_webpage( url=url, **kwargs )

Error Logs C:\xampp\htdocs\project\venv\Scripts\python.exe C:/xampp/htdocs/project/scrap.py config - INFO - Got response <Response [200]> from https://en.wikipedia.org/robots.txt config - INFO - Got response <Response [200]> from https://en.wikipedia.org/wiki/EndNote webpage - INFO - Starting save_complete Action on url: [' https://en.wikipedia.org/wiki/EndNote'] parsers - INFO - Parsing tree with source: <<urllib3.response.HTTPResponse object at 0x03617850>> encoding and parser <<lxml.etree.HTMLParser object at 0x035BEC30>> Traceback (most recent call last): File "C:/xampp/htdocs/project/scrap.py", line 21, in **kwargs File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\api.py", line 88, in save_webpage wp.save_complete() File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\webpage.py", line 275, in save_complete self.parse() # call in the action File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\parsers.py", line 192, in parse o = factory(elem, attr, url, pos) File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\elements.py", line 456, in make_element rel_path = pathname2url(obj.relative_to(utx.file_path)) File "C:\xampp\htdocs\project\venv\lib\site-packages\pywebcopy\urls.py", line 469, in relative_to rel_path = os.path.relpath(head, start) File "C:\Users\My Computer\AppData\Local\Programs\Python\Python37-32\lib\ntpath.py", line 562, in relpath path_drive, start_drive)) ValueError: path is on mount 'L:', start on mount 'C:'

Process finished with exit code 1

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rajatomar788/pywebcopy/issues/14?email_source=notifications&email_token=AIGSNTQMDJFGTCEGUSFPABTP3XF6ZA5CNFSM4H2WGUY2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3CS5PQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AIGSNTR33FLNJG6OTXRBUFTP3XF6ZANCNFSM4H2WGUYQ .

KhairiAnuar commented 5 years ago

Still getting same error with this 'project_folder': 'C:/xampp/htdocs/project/assets/saved_webPages' but I am using a different tool now, thanks tho