oneano 8 Posted January 17, 2013 Report Share Posted January 17, 2013 I am scraping a math problem, this worked just fine a few weeks back, today it isnt working at all. I can scrap the inner text, it is a simple but random math problem such as 4 - 2 = set(#math, $scrape attribute($element offset(<tagname="strong">, 26), "innertext"), "Global")type text(<name="captcha_math">, $eval(#math), "Standard") type text does not seem to work, $eval never seems to do anything. Has something changed? Am I doing this wrong? Quote Link to post Share on other sites
VaultBoss 310 Posted January 17, 2013 Report Share Posted January 17, 2013 You can't $eval a string (text) expression, it needs to be math between numerals. You'll have to extract the separate values... Or even easier, navigate to Google, paste it there a a search string and scrape the result: http://www.google.com/search?q=4+-+2+%3D Quote Link to post Share on other sites
k1lv9h 76 Posted January 17, 2013 Report Share Posted January 17, 2013 Hi, If the value of #math is 4 - 2 =Try this updated code: type text(<name="captcha_math">, $eval($trim($replace(#math, "=", $nothing))), "Standard") The code should remove the "=" and any extra spaces. Kevin Quote Link to post Share on other sites
blumi40 222 Posted January 17, 2013 Report Share Posted January 17, 2013 Againset(#math, "5 - 3 =", "Global")add list to list(%math, $list from text(#math, "-"), "Delete", "Global")set(#m1, $trim($list item(%math, 0)), "Global")set(#m2, $trim($replace($list item(%math, 1), "=", $nothing)), "Global")set(#math, $subtract(#m1, #m2), "Global") Quote Link to post Share on other sites
illmill 87 Posted January 21, 2013 Report Share Posted January 21, 2013 OP, I hope you don't mind me sorta hijacking your thread, but I'm having problems with eval and I don't want to clutter the forum with a new thread. eval seems to never work. What gives? It's weird, though, because on the bot I'm currently working on it will work when I go through the nodes manually and right click then select run node. But when I click play to run it it's just giving me nothing for a simple math expression. I have a variable and I want to have it loop five times the value of that variable. simple enough: set(#var, "5", "Global")set(#loop, $eval($multiply(#var, 5)), "Global") Am I not able to use a variable inside an eval expression? But I swear it's working when I slowly go through and right click to run the nodes.... Quote Link to post Share on other sites
north_star 16 Posted March 22, 2013 Report Share Posted March 22, 2013 $eval function is not working for me also when I set it on #VAR, but when I click run Node, its shows the result, any idea why this is happen..? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.