Removing characters like amp;
Hi,
Im trying to scrape the website www.wetseal.com. http://www.wetseal.com/pod/stores/default.asp?stateID=TX&stateName=Texas&token=
Im trying to save the part highlighted in bold to a session variable as follows,the ouput is as follows, TX&stateName=Texas.
I would need your help in removing the amp and passing only the value TX&;stateName=Texas.
Thanks,
Ganesh Ethiraj.
Removing characters like amp;
Hi,
There are a few ways you could go about this, but the simplest would probably be to simply create the extractor pattern so that it only grabs the pieces you need, like so:
http://www.wetseal.com/pod/stores/default.asp?stateID=~@STATE_CODE@~&stateName=~@STATE_NAME@~&token=
If that doesn't do the trick, you could always replace the entities in a script like this (assuming the session variable "STATE_TEXT" contains the value "TX&;stateName=Texas"):
stateText = session.getVariable( "STATE_TEXT" );
stateText = stateText.replaceAll( "&", "&" );
session.setVariable( "STATE_TEXT", stateText );
Kind regards,
Todd Wilson