html-sketchapp / html-sketchapp

HTML to Sketch export solution
MIT License
1.85k stars 116 forks source link

Could someone please suggest, is it possible to get data if the website requires login? #180

Open Renian1 opened 4 years ago

Renian1 commented 4 years ago

Could someone please suggest, is it possible to get data if the website requires login?

rt3norio commented 4 years ago

need it too. +1

tlenex commented 3 years ago

I think, if it's basic auth, then you can just visit html with the URL like: http://LOGIN:PASSWORD@example.com/path.

For modern auth solutions, currently the HTML can be downloaded manually (File -> Save as... in the browser) and then crawled from your filesystem. No credentials in header/cookie support currently AFAIK.

coderitual commented 3 years ago

hey @Renian1 @rt3norio , borwser injecting is out of the scope of html-sketchapp. You have full freedom what tool you gonna use to obtain page.

The best idea would be to look at examples usage here: https://github.com/html-sketchapp/html-sketchapp-example Or even take a look on our internal usage here: https://github.com/brainly/html-sketchapp-style-guide

In above examples we're using puppeteer to control borwser window and inject our script (which in turn uses html-sketchapp lib) into that window. Because puppeteer allows controlling browser window you can easily use its api to login to desired page and obtain document/html node for further processing using html-sketchapp