I'm using a hosted cart system to manage a ecommerce platform. The system uses form submission to add items to the user's cart. I want to write a javascript library to allow me to add things to the cart with JS, but I will need to see what the platform is submitting so I can copy it appropriately.
Any advice how to best sniff out what the default form info is getting submitted to the form so I can copy it via jquery?
Thanks!
Open your browser's console; Chrome has it built-in, Firefox has Firebug.
The entire request will be viewable in the network tab.
Another, more-complicated option is to set up a trivial local proxy and dump the request.
You can use TamperData. It's a nice addon for Firefox that let's you view and edit this data.
Firebug and it's derivatives also has the functionality if you have that.
Firebug on firefox using the console and turn on 'persist' it will tell you whats going on after the page posts and stuff. :)
Related
I have to scrape a website which i've reviewed and i realised that i don't need to submit any form. I have the needed urls to get the data.
I'm using NodeJs and Phantom.
My problems source is something related with the session or cookies (i think).
In my web browser i can enter in this link https://www.infosubvenciones.es/bdnstrans/GE/es/convocatorias, hit on the form blue button with text "Procesar consulta". The table below will be filled. In dev tools on network tab you can see a XHR request with a link similar to https://www.infosubvenciones.es/bdnstrans/busqueda?type=convs&_search=false&nd=1594848133517&rows=50&page=1&sidx=4&sord=desc, if you open it in a new tab, the data is displayed. But if you open that link in other web browser you get 0 results.
That's exactly what is happening to me with NodeJs and Phantom and i don't know how to fix it.
If you want to give Scrapy a try, https://docs.scrapy.org/en/latest/topics/dynamic-content.html explains how to deal with this type of scenarios, and I would suggest reading it after completing the tutorial.
The page can also be handy if you use other scraping framework, as there’s not much that is Scrapy-specific, and for Python-specific stuff I’m sure there will be JavaScript counterparts.
As for Cheerio and Phantom, I’m not familiar with them, but it is most likely doable with them as well.
It’s doable with any web client, it’s just a matter of knowing how to use the tool for this purpose. Most of the work involves using your web browser tools to understand how the website works underneath.
I have been trying to bypass my 3g modem's login page since I forgot my password. I used inspect element from chrome and I got a piece of code that accepts the validity of the username and password from an unkown method. It uses the if else method. I am trying to edit the js code but the changes are not reflected or are simply not made.
For those who may think I am trying to access someone else's network illegally,
I hereby declare that I do own the modem and I will not use the methods given by the users for illegal purposes.
Any help is appreciated.
Thankyou.
In Chrome, in the source tab of the developer tools, you can click the Filesystem "subtab" which allows to override remote scripts with local ones:
Not sure if this will allow you to hack anything like router's authentication since the entry point is the HTTP endpoint, not the web page.
I cannot get the google maps plugin to load correctly
How can I make it so that my contact form actually sends completed forms to my email or collects it in some way? I would eventually like to add a landing page that pops up thanking them for their form submission, (or maybe just add code to change the submit button to say "Thank you!" after clicked), but my first problem is the form has no way to save the info.
Thanks all!!
The problem appears to be that you're missing a developer's API Key.
https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error
You can get a key here:
Google API Key Docs
FYI - You can see what issues your page has using the Developer Options menu in Chrome, or in Firefox by using the Web Developer Tool from the menu on the right.
As far as collecting information from a form, there are many samples online for saving form data, but they all depend on what development language you are using.
I am working on a small application but I am stuck on a problem. I want stored form element values on a HTML page when filled in on one browser(Ex. Firefox) and auto fill data when same page is loaded in another browser(Ex. Chrome). If anybody has any ideas please help me.
Unless clients can login and you're willing to share this data via your server, you can not change behavior of a different browser from your current, so in your example Firefox can not change a cookie, localstorage or whatever of Chrome. Browsers tend to only share information like cookies when they are first ran; such as with you the import wizard from Firefox.
I can think of two alternatives to achieve this:
An authentication system where the data is stored server-side.
Through custom browser extensions. You could create a custom browser extension that directly writes the data of the other browsers. This does require the user to install that extension though.
This link explain how to achieve that http://www.nczonline.net/blog/2010/09/07/learning-from-xauth-cross-domain-localstorage/
It's not simple, but it's the way that I know it can be done at the moment without the use of cookies.
I've made a Chrome extension with an options page. The data is saved in localstorage and works just fine.
Chrome doesn't sync the localstorage to the cloud, just the extensions. This means that any user data will not sync to other computers of the same google account.
I can not find an API at http://developer.chrome.com/extensions/docs.html which allows me to sync the user-chosen preferences.
What methods do you suggest?
In the (hopefully near) future, you'll be You are now able to store stuff in chrome.storage.sync, and it will be synced automagically.
Unless you need something right now, do consider putting all your configurations in an single object, sometime later you'll be able to just sync it!
Edit: now this is available in stable Chrome!
Nathan Moos told you truth :) But you don't need to write it by oneself, you can use Ankit Ahuja solution from Sylebot extension. You will need file js/sync.js. Source code is great, and it works great!
You should be able to use HTML5 WebDatabases, but you cannot. See comments below.
You could serialize some of the options to a bookmark and tell the user to enable bookmark sync. Then, you could read from the bookmark or build a pseudo-"localStorage" object around the bookmark.
You could try to do it with Google Docs like Chrome does with bookmarks. I don't know how far the api reaches but this seems a rather basic operation.