JavaScript AJAX remote logger [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am working on JavaScript application on the platform which does not have support for log output, does not allow opening new windows for logger output and has nothing like Firebug or Safari debugger on it...
So far I was using the floating <div> on z-index 2 and I logged the text inside, but this is not sufficient. I am looking for some lightweight JavaScript JSONP logger and some PHP or Tomcat server counterpart...

I recently stumbled upon this presentation of N. Zakas, and implemented the technique explained there. It is quite simple but IMHO very effective
http://www.slideshare.net/nzakas/enterprise-javascript-error-handling-presentation
the idea is to simply issue a call to a server side component (I used a .net handler but it could be a php file as well) which takes some param, log the param values and returns a 1x1 image stream back. What I like the most is that there's no need to involve ajax calls at all.
The code from the presentation is as follows:
function log(severity, message) {
var img = new Image();
img.src = "log.php?sev=" + encodeURIComponent(severity) +
"&msg=" + encodeURIComponent(message);
}
log(1, "something bad happened");

Warning: No Longer Working!
As #JohnSmith commented below, the solution suggested here appears to no longer be functional.
An alternative to hosting your own server logging might be JSConsole.com. It's a general purpose remote debugger for JavaScript. Just register a listener, paste the script tag it generates into your page, then fire up an instance on any device. The debugger is bidirectional, so not only does the logging get forwarded to the remote console on JSConsole, you have full access to the JS environment on the remote client.

Related

Browser-based JS database [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last month.
Improve this question
I'm working on a little side project and wanted to keep it as simple as possible.
So app will have no back end, it will just be a single html page with some local javascript included that can be passed around and run locally.
Given those requirements, I'm looking for a some sort of solution that would let me store and load data like you would a database, in a way the data can be permanently stored in a file. So preferably, being able to use a json file like a NoSQL database.
I've looked at lowdb, alasql, and lokijs, but none of those seem to meet my requirements. They either need a node server to function, or only use local storage or memory to store data.
You can't (except with an ugly workaround).
Such an application would require JavaScript to read/write from disk while running inside a webpage in a browser, and it's not technically possible. This has nothing to do with the file format.
However...
The workaround is to keep all the data in a JSON file, then load it dinamically via JavaScript (for example, with drag and drop). Then when you need to save it... you allow the modified JSON to be downloaded, and once downloaded you'd replace the old JSON with this new one, manually.

what is the easiest web scraping tool that handles javascripts [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I would like to make a web scraping application that is able to log in to a website (I was able to do this with twill (python)), and also to be able to execute JavaScript which trigger access to other pages.
I would definitely prefer to use something in python, but I am ready to try something new. I have installed mechanize, watir, Hojocki, etc. but not sure if this really helps.
I'd recommend PhantomJS.
It's a full Webkit browser, but headless and scriptable.
It's ideal for this sort of thing.
I believe there are a few modules (such as Ghost), but I have used Selenium/WebDriver for things like this. It is ostensibly a testing framework, but it provides you with a lot of methods to allow you to interact with the page just as if you had loaded it as a normal user. You also have the benefit of running it so that a browser actually opens and you can watch the code execute (makes debugging easier), or in a 'headless' mode where the code just executes (there are other sites/SO answers with much better explanations than I can give :) ).
That being said, Ghost looks great as well, so try them both and hopefully one will get you what you need!
Also, see Javascript (and HTML rendering) engine without a GUI for automation? for a similar question that may have some additional answers.
I would recommend Octoparse, a free web scraper for Windows.
It's not programmble but it's very easy to use. But there's no Mac version.So...
JavaScript can be handled by Octoparse btw.

Site monitoring tool to look for javascript errors [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I am currently working on a site that includes javascript code that we get from several different sources and need to run on the site I maintain. Every once and a while some of this code breaks without our knowing until its too late. Is there a monitoring tool that will crawl our site and look for javascript errors and report them or could this be incorporated into a selenium test somehow?
On the sites I develop, I wrap everything in try ... catch blocks, and if the exceptions I catch cannot be handled, I always generate an AJAX request to a script which emails an error report to the development team with as much information as I can gather.
If the code is code you didn't write yourself and try...catch blocks would be difficult to add, you can use the window.onerror handler instead:
<script type="text/javascript">
window.onerror = function()
{
// Your code to generate an AJAX request to your error report script here
}
</script>
I know this post is old, but recently we've launched a tool that does this :)
It's called ConsoleWatch - https://www.consolewatch.io/
It lets you scan whole websites for JS errors and also schedule repeating scans with reports, so you might find t handy!
It would also be smart to utilize a tool that will catch any JavaScript errors that might happen after production. There're several tools out there but I recommend RootCause because it will allow you to automatically reproduce any user errors.
Disclaimer: I work for RootCause. Our software automatically reproduces JavaScript errors and lets you replay user sessions live in your browser with the click of a button.

Python library for rendering HTML and javascript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is there any python module for rendering a HTML page with javascript and get back a DOM object?
I want to parse a page which generates almost all of its content using javascript.
The big complication here is emulating the full browser environment outside of a browser. You can use stand alone javascript interpreters like Rhino and SpiderMonkey to run javascript code but they don't provide a complete browser like environment to full render a web page.
If I needed to solve a problem like this I would first look at how the javascript is rendering the page, it's quite possible it's fetching data via AJAX and using that to render the page. I could then use python libraries like simplejson and httplib2 to directly fetch the data and use that, negating the need to access the DOM object. However, that's only one possible situation, I don't know the exact problem you are solving.
Other options include the selenium one mentioned by Łukasz, some kind of webkit embedded craziness, some kind of IE win32 scripting craziness or, finally, a pyxpcom based solution (with added craziness). All these have the drawback of requiring pretty much a fully running web browser for python to play with, which might not be an option depending on your environment.
You can probably use python-webkit for it. Requires a running glib and GTK, but that's probably less problematic than wrapping the parts of webkit without glib.
I don't know if it does everything you need, but I guess you should give it a try.

Looking for a specific FireFox extension / program for Form posting [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am looking for either a FireFox extension, or a similar program, that allows you to craft GET and POST requests. The user would put in a form action, and as many form key/value pairs as desired. It would also send any cookie information (or send the current cookies from any domain the user chooses.) The Web Developer add-on is almost what I'm looking for; It let's you quickly see the form keys, but it doesn't let you change them or add new ones (which leads to a lot of painful JavaScript in the address bar...)
If you're a windows user, use Fiddler. It is invaluable for looking at the raw Http requests and responses. It also has the ability to create requests with the request builder and it has an auto responder also, so you can intercept requests. It even lets you inspect HTTPS traffic and it has a built in event scripting engine, where you can create your own rules.
Actually I think Poster is what you're looking for.
A Screen shot of an older Poster version
You may want to check out the Tamper Data extension which allows you to easily intercept and manipulate the request parameters among other features.
If you've got Greasemonkey installed you might want to try the XSS Assistant user script: http://www.whiteacid.org/greasemonkey/#xss_assistant
The DOM Inspector will let you add/edit/remove inputs - copying existing ones is the easiest way of adding new ones. I highly recommend getting Inspect This as well.
Look for a extension called Poster.
Poster looks nice and complete. For reference, I will add UrlParams to the list, but looks like Poster is better.
I think tamper data would do the trick....live http headers addon would also do the same.

Categories