views:

64

answers:

1

i wanna get a price inside a page and then multiple it by 0.93 then write the result after first price. but i couldn't be able to grab the price from page.

for example i want to grap "900 TL" string from "900 TL"

you can see all codes of page by visiting http://www.sahibinden.com/cok%5Ftemiz%5Fasus%5Ff3jp%5Ft7200%5F2ghz%5F2gb%5Fram%5F256%5Fmb%5Fharici%5Fekran%5Fka-49WQQaXQQ17829315WQQpXQQdisplayitem

thx a lot.

edit: the "f16 bold" string counts only 1 on that page. so maybe we can get "900 TL" with this..

+1  A: 

Try this:

document.getElementsByClassName('f16 bold')[0].textContent = document.getElementsByClassName('f16 bold')[0].textContent + ' (' + parseInt(document.getElementsByClassName('f16 bold')[0].textContent)*0.93 + ')';

Note: getElementsByClassName has poor browser support (in Firefox, 3.0+ I believe).

cpharmston