Is any way to change selector on the fly?

Questions & Answers about Helium Scraper 3
Post Reply
jhon96
Posts: 1
Joined: Thu Sep 24, 2020 11:00 pm

Is any way to change selector on the fly?

Post by jhon96 » Thu Sep 24, 2020 11:27 pm

Hello, I need the ability to change selectors on the fly for the data from db. Is any way for this?

For example, I've made selector that selects link with text "hello", I manually changed text "hello" to "see you later", and now it selects the link with text "see you later". I need the ability to make this changes on the fly for texts from database. Is it possible?

webmaster
Site Admin
Posts: 510
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: Is any way to change selector on the fly?

Post by webmaster » Fri Sep 25, 2020 1:12 am

You could start by importing this premade from the wizard. Just right click Project Explorer -> Globals -> Import Premade and visit the premade page. Then you'll be asked for a global name (you can just keep the default), and a selector and gatherer. For the gatherer, just use Gather.Text and as a selector use a selector that selects all the links you'll need, regardless of the text, since later on you'll filter by text.

Then, whenever you need to select a link with the text "my text" you can just do this:

Code: Select all

FindElement
   ·  "my text"
Or to use text from a database:

Code: Select all

Query.MyQuery
as (text)
FindElement
   ·  text
Juan Soldi
The Helium Scraper Team

Post Reply