Web Scrapers Generator BrowserExt


Searches a database record with the given attributes and/or condition.

dbfind(connection, table, attrs[, condition = ''[, params = dict()]])


connection Connection ID established by dbconnect.
table Table name.
attrs Attributes dictionary that will be searched for in the database. The key of the dictionary element corresponds to the name of the column in the table
condition The condition for the search. If you can not set the condition by using the attrs, use this option. Can contain parameters such as :param. For example, to specify that the value of an attribute is null, then the condition can be specified as 'column is null'.
params Dictionary of parameters that were defined in the condition, the key correspond to the name of the parameter.

Returned value: an array of found records. Each record is a dictionary. If no record is found, it returns an empty array.

This function can not be performed in the "Editor".

Example 1. Lets suppose that there is products table in the test database, containing id, t, d and p columns. At the first place we form the table from the returned data, then we will search for every string in the database. If we don't find a record with the relevant data, then insert a new record to the database.

Example 2. Search with the condition and parameters.