<div class="grid--cell fl1 lh-lg">
<div class="grid--cell fl1 lh-lg">
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, <a href="/help/reopen-questions">visit the help center</a>.
</div>
</div>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2013-04-22 07:14:39Z" class="relativetime">7 years ago</span>.</div>
</div>
</aside>
I would like to create a JavaScript code that would grab this data from another website and put it all into a .TXT file, Maybe even if it can be converted to a XML file would be even better if possible.?
If not JavaScript anything else will be fine.
I wish to grab the price and the item name and I'm not completely sure on how to do that.
Website is http://www.bigw.com.au/electronics/computers-office/computer-accessories/webcams if you need to read their source to help.
</div>
you can get the source code of page by saving the page
or you can use
Right click on webpage ->view source
Rip a website client-side with a browser and javascript? No problem.
yahoo yql... (instead of a php? proxy serverside script)..
I have a sneaky suspicion you do not own/control the external link site, so getting content from a different site, would fall under cross-domain security restrictions (to a modern browser).
So in order to regain 'power to the user', just use http://query.yahooapis.com/.
EXAMPLE 1:
Using the SQL-like command:
select * from html
where url="http://stackoverflow.com"
and xpath='//div/h3/a'
The following link will scrape SO for the newest questions (bypassing cross-domain security bull$#!7):
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20%0Awhere%20url%3D%22http%3A%2F%2Fstackoverflow.com%22%20%0Aand%20xpath%3D'%2F%2Fdiv%2Fh3%2Fa'%3B&format=json&callback=cbfunc
As you can see this will return a JSON array (one can also choose xml) and calling the callback-function: cbfunc
.
Indeed, as a 'bonus' you also save a kitten every time you did not need to regex data out of 'tag-soup' and you don't need to mess with lord Cthulu.
Do you hear your little mad scientist inside yourself starting to giggle?
Then see this answer for more info (and don't forget it's comments for more examples).
Once you have the data, you can always ajax it back to your server, so repeating this 1000 times is no problem (as long as there is space on your server).
Good Luck!