I have some elements generated with PHP and I would like to know if it is possible to select an element with an incomplete id, example:
Not with ID selectors since they require complete ID names, but with substring attribute selectors:
div[id^="as_"]
div[id^="bs_"]
But since your elements have a class
attribute anyway, why not add a common class to each group of elements and select by that class to make things simpler? You should be able to determine the grouping class using PHP as you do to generate the IDs.