anggun123 wrote: ↑Tue Aug 17, 2021 12:24 pm
SyntaxError: missing variable name
Yeah, because you are still using the "old" Version (with a Comma after the '{{!EXTRACT]}'), while that Comma needs to be a Semi-Colon, to separate the x2 'var' Commands...
Or the 2nd "var" Command (in "var x,y,z;") needs to be removed, then you can use Commas between all 4 Vars, like Commas are used after "x" and "y"..., but I "usually" prefer to declare the "z" or "x,y,z" Var(s) separately from other Vars needed in the 'EVAL()'...
I retested, and the updated Version (with the Semi-Colon) does work correctly on both URL's...:
Code: Select all
VERSION BUILD=8820413 RECORDER=FX
SET !EXTRACT_TEST_POPUP NO
TAB T=1
'URL GOTO=https://shopee.com.my/-Pre-Order-Givenchy-Mini-Antigona-Bag-In-Crocodile-Leather-Black-BB500JB0LK-3-weeks-i.295381963.3855955984
TAG POS=1 TYPE=DIV ATTR=TXT:Product<SP>Description
TAG POS=R1 TYPE=DIV ATTR=TXT:*#* EXTRACT=TXT
SET Pre_Order_Data EVAL("var s='{{!EXTRACT}}'; var x,y,z; x=s.split('#'); y=x.slice(1); z='#'+y.join('#'); z;")
PROMPT EXTRACT:<BR>_{{!EXTRACT}}_<BR><BR>Sep:<SP>_#_<BR><BR>Pre_Order_Data:<BR>_{{Pre_Order_Data}}_
(Tested in iMacros for FF v8.8.2, PM v26.3.3, Win10_x64.)
Notice the 'slice(1)' Command, which allows to remove the 'split()[0]' Element from the Array, in order to "ignore" all Data before the 1st "#", I don't use that Command very often...
The same ('slice()') Command/Method also works on Strings, but I then prefer to use the 'substring()' Command, which does exactly the same..., as I remember more "easily" that 'substr()' is with Index + Length, and 'substring()' is with 2 Indexes...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...