Replies: 15 comments
-
You need to pass bypass_robots=True to the get_config function. The error states that your local website has robots.txt rule which prohibits bot or script access. It can be just bypassed using the arguments above. |
Beta Was this translation helpful? Give feedback.
-
config = get_config(url,bypass_robots=True) Exception has occurred: IndexError |
Beta Was this translation helpful? Give feedback.
-
You need to verify whether their are forms before applying [0] index. Common sense yaar. Check the url property of the wp object before hand whether their wasn't any redirects. Then check the available forms using get_forms method. |
Beta Was this translation helpful? Give feedback.
-
print(wp.url) |
Beta Was this translation helpful? Give feedback.
-
if I login manually, can I manually copy the cookies and pass to pywebsave? If is only showing the spinner and the java code /js/outBIMYN2XL.js that opens the login/password does not appear to be executed.
|
Beta Was this translation helpful? Give feedback.
-
Just login with your browser and then copy the cookies to the pywebcopy session headers. |
Beta Was this translation helpful? Give feedback.
-
kindly show me where these session headers are.
--
Mickey Cohen
Shanit Ltd.
CEO
POB 23410, Jerusalem 9123302, Israel
M: +972-54-758-6312
Skype: tadam_98
***@***.***
…On April 5, 2024 2:51:53 PM GMT+03:00, Raja Tomar ***@***.***> wrote:
Just login with your browser and then copy the cookies to the pywebcopy session headers.
--
Reply to this email directly or view it on GitHub:
#124 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You can access the session using the .session attribute of the wp object that you created. Then use .headers attribute of the session to set the headers including cookies. |
Beta Was this translation helpful? Give feedback.
-
URLmain = "http://localhost:9000/" This sets the cookies correctly. But the next save_website is not tied to this session at it gets the url as a parameter not the session. |
Beta Was this translation helpful? Give feedback.
-
Use the wp object style approch as you did in the start. Use wp.get methods to open pages. Then the session would remain same for all the requests. |
Beta Was this translation helpful? Give feedback.
-
I have built a url that sets cookies. Then I used get_config to start a session Then I was not sure how to use the usl_cookies to set the cookies. I tried:
But this did not set the cookies. |
Beta Was this translation helpful? Give feedback.
-
Anyway, I maybe copying the cookies may not work as they are JWT and could be associated with some seed in each instance. |
Beta Was this translation helpful? Give feedback.
-
You may have proceed with trial and error method. It is understood that there is no javascript support in the pywebcopy. So each javascript based site would require some different approach to get around. At the moment I can only tell you to see the requests.Session usage and documentation. Because cookies and auth is handled by that quite capable library. |
Beta Was this translation helpful? Give feedback.
-
For anyones need, a way to set cookies reliably. See issue #126
|
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a website running on a docker that is accesses locally:
http://localhost:9000/dashboard?id=face-animation
I need to login with two fields: login and password.
When I run it I get on wp.get(config['project_url']):
How do I write the code to save this website ?
When I login to the site it creates two cookies:
JWT-SESSION
XSRF-TOKEN
Which I need to carry on into the pywebsave
Beta Was this translation helpful? Give feedback.
All reactions