bman46 0 Posted December 10, 2013 Report Share Posted December 10, 2013 Good day all. I've been trying to scrape a variable and it comes in pretty dirty due to the code on the site The scrape ends up looking like this ------------------------------ #IMPRESSIONS: 3,598 Impressions ----------------------------- So as you can see there is a lot of weird spacing around the number i need. I do a replace to get rid of the impressions, that works fine. Getting rid of the spaces/breaks is causing grief. You can copy the spaces to a notepage file and find replace them with nothing. The only problem is that it's not reliable, it'll work for a while then not work. Any reliable ways to clean up these weird spaces so that I get ONLY the number as the variable? Thanks for your help. Quote Link to post Share on other sites
bman46 0 Posted December 10, 2013 Author Report Share Posted December 10, 2013 also the number is always different, i tried trim but if i add that above string as the trim, it always ends up putting 3,598 as the variable Quote Link to post Share on other sites
bman46 0 Posted December 10, 2013 Author Report Share Posted December 10, 2013 I think I figured this out by replacing the number with the variable with Trim. Quote Link to post Share on other sites
the_way 52 Posted December 11, 2013 Report Share Posted December 11, 2013 trim will work, so will regex too, and even replace, 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.