Type of product

I write userscript in Tampermonkey for Avito.ru site. His task - when opening the product addition page, the script automatically selects the category and type of goods. The current code state is: `$ (document) .ready (function () {

//Бытовая электроника -> Товары для компьютера $('input[value="101"]').next().click(); //Аксессуары $('select[name="params[483]"] option:eq(11)').attr('selected', 'selected');});` 

The essence of the problem: the category and subcategory is selected, but the drop-down list with the type of goods is not displayed. If you click "Continue", an error will pop up and a drop-down list will appear, the second part of the code in the script will work.

As I understand it - it loads dynamically when you click on a category by mouse, but for some reason it refuses to be loaded when clicked through JQuery. I use jQuery because it is more convenient for me.

Even if you do .click () on all three elements - the view is not loaded. See the picture. input tree

Question: how to solve this problem? How to make the script itself choose the type of product immediately?

  • press the wrong element =) here is the list and does not appear =), but if you need more precisely, you need a link to this list - bsbak
  • If you click on the label or on the input - the category is not selected. - Agnaman the Shaman
  • Give a link to this list - bsbak
  • avito.ru/additem - Agnaman Shamansky

2 answers 2

Found the answer to your problem. The problem was that I connected the jQuery a second time, but on Avito it already exists, although the source does not show the connection. There was a conflict.

 // @require http://code.jquery.com/jquery-latest.js 

After deleting this line, everything worked as it should. Thank you all for your attention!

    To avoid version conflicts, you need to read about it:

     var $ = jQuery.noConflict(true);