Regex Post-processing Function

Regex Post-processing function can be used to extract the string in our extracted field result. For example, I have this scraping agent “Regex Function Example(Post-Processing)” in my account and I want to extract state from City field. Here, we can use the Regex Post-processing function to extract the state from City field.

Before

Steps

  1. Edit the scraping agent by clicking on the Edit tab

  2. Add a new field, name it something like me named it State and selector will be same as for City field

  3. Now, click on the Add Post-Processing button to add the Regex Post-Processing function, The below dialog box will appear

  4. Now, enter the Regular expression as [^,]+,\s*(.*) in Expression parameter and enter the Group index as (1)in Group parameter which shown in above screenshot.

  5. Then, Save the function and the scraping agent configuration

  6. And finally, re-run you agent to apply the changes.

After Regex Function

Now, if we notice the screenshot below, we find the new field State with the updated result.

14 days free trial

Automate your business with advanced, fully-featured agents on Agenty. Fast, scalable and no-code web automation tool for scraping, change monitoring and more...

Sign up for free →

No credit card required