first off, let me include some information:
VERSION BUILD=12.6.505.4525, Trial Version on Windows 10 64-bit, English with Browser IE11. Demo scripts and another script that I built today work well.
I am trying to build a macro that will run through a series of weekends for a car rental company and will store the advertised price in a csv file. I will then later be able to look at the data, mark which weekends I find interesting and - that will be a future project - use a second macro to book those weekends.
The company's website is nice enough to include all the data I really want in one "object" up top. "Object", because here is where it gets tricky for me: I don't know how to call that, let alone grab it. It is not something that drives the display on the website, and I can't seem to use the right "find" option for the TAG command - however I wonder whether it would not be much more elegant go via xpath, if that is possible here.
How would I go about
1) for beginners, and to understand how this works, grabbing everything inside the variable sxux?
2) to really get what I need, grabbing the part marked in green, i.e. the entire string in quotation marks right after "prc_wc" (our, put differently everything between prc_wc and prc_pp)?
Below is the code of the snippet I am trying to get.
Code: Select all
<script type="text/javascript">
var sxux = {"user_id":"","user_email":"","agia":"","uci":"xxx","uda":"16.06.2021","uti":"12:00","rci":"40272","rda":"19.06.2021","rti":"09:00","uliso":"DE","lor":"3","days_til_begin":"306","ctyp":"P","grp":"",
"class_name":"","offers_extrema":"MCMN|29.68|XXAX|209.52|P|53|DEUF3000|P|49|DER1E000","loginstate":"Public","sx_res_tpl":"offerselect","wakz":"EUR","prpd":"","sim_external":"0",
"layout":"standard","view":"","prl":"","rType":"P","rValue":"","insu":"E","fir":"60","posl":"DE","offerposl":"FR","total":"","total_gross":"","prc_wc":"S1:A|S2:A|S3:A|M1:A|M2:A|M3:B|L1:A|L2:B|L3:A",
"u_d":"desktop","prc_eq":"MCMN:42.99:128.98|ECMR:43.66:130.98|CCMR:48.66:145.98|CDMR:49.66:148.98|CLMR:52.66:157.97|CWMR:53.66:160.97|IDMR:55.66:166.97|CLAR:56.32:168.97|
CPMR:56.66:169.97|CWAR:57.32:171.97|ILMR:57.99:173.97|IVMR:57.99:173.97|IWMR:58.32:174.97|IDAR:59.65:178.96|IFMR:59.65:178.96|SDMR:60.65:181.96|ILAR:61.99:185.96|
CPAR:62.32:186.96|IWAR:62.65:187.96|SWMR:62.32:186.96|SSMR:63.65:190.96|SFMR:64.65:193.96|FDMR:66.65:199.96|FWMR:68.32:204.95|FDAR:71.33:213.99|FWAR:73.33:219.98|
PDAR:78.99:236.98|PSAR:81.66:244.97|PWAR:82.32:246.97|LDAR:83.32:249.97|PFMR:83.99:251.97|LWAR:83.99:251.97|LSAR:88.66:265.97|SVMR:88.99:266.96|LFAR:92.32:276.96|S
VAR:98:293.99|CCAN::|SSAX::|FCAR::|FWAX::|XDAR:131.33:393.99|XFAR:132.99:398.98|LCAR::|XSAR:135.33:405.98|LPAN::|LWAX::|LFAE::|LDAN::|LWMR::|LFAJ::|XCAN::|XJAN::|XVAN::
|PXBR::|LFAN::|XLAN::|XWAR::|XFAN::|XCAR::|XJAR::|XXAX::","prc_pp":"","prc_poa":"","resn":"0","sproducts":"Car;MCMN,Car;ECMR,Car;CCMR,Car;CDMR,Car;CLMR,Car;CWMR,Car;IDMR,Car;
CLAR,Car;CPMR,Car;CWAR,Car;ILMR,Car;IVMR,Car;IWMR,Car;IDAR,Car;IFMR,Car;SDMR,Car;ILAR,Car;CPAR,Car;IWAR,Car;SWMR,Car;SSMR,Car;SFMR,Car;FDMR,Car;FWMR,Car;FDAR,Car;FWAR,Car;
PDAR,Car;PSAR,Car;PWAR,Car;LDAR,Car;PFMR,Car;LWAR,Car;LSAR,Car;SVMR,Car;LFAR,Car;SVAR,Car;CCAN,Car;SSAX,Car;FCAR,Car;FWAX,Car;XDAR,Car;XFAR,Car;LCAR,Car;XSAR,Car;LPAN,Car;
LWAX,Car;LFAE,Car;LDAN,Car;LWMR,Car;LFAJ,Car;XCAN,Car;XJAN,Car;XVAN,Car;PXBR,Car;LFAN,Car;XLAN,Car;XWAR,Car;XFAN,Car;XCAR,Car;XJAR,Car;XXAX","product_name":"","pn":
"Reservation-Pkw-Offerselect","lg":"fr","ibe":"PKW|Default","vat":"VAT_Y|19","osl":"79|61|18","wor":"Wednesday","delcol":"DEL_notset|COL_notset","pm":"","cpc":"","fdr":"N","ic":"insu:0",
"bepc":"","br":"",
"grp_p":"","ex_p":"","ec_f":"","ec":""}
</script>
Code: Select all
TAG POS=1 TYPE=INPUT ATTR=CLASS:sxux EXTRACT=TXT
TAG POS=1 TYPE=VAR ATTR=TXT:"sxux" EXTRACT=TXT