0

I only want to show rank 1 pokemon. i am able to replace combobox with my code. but rank 1 pokemon are not coming. How should I solve this? I am using htmlagilitypack, cefsharp and vb.net. this is the code i use

_browser.EvaluateScriptAsync("(function() { return document.getElementsByClassName('form-control col-3 col-sm-2')[1].selectedIndex = '1';})();")

The content of the combobox changes but does not affect the page. I couldn't figure out what to do. I tried all the codes. but dont work. i dont change pokemons

i want only rank 1 pokemons (#1)

i want it

Emin Yalçın
  • 11
  • 1
  • 2
  • Run your JavaScript in DevTools, make sure it's working see https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting#javascript-debugging if it works in DevTools then your probably executing the JavaScript to early, before the DOM has been updated. – amaitland Aug 31 '21 at 21:26
  • hi master; how i try it? im new programmer. this code is opera browser. when i chose rank1 then its code `` – Emin Yalçın Sep 01 '21 at 10:49
  • Open Devtools and execute your JavaScript in the console. – amaitland Sep 01 '21 at 19:20
  • i write this code. its work again but didnt show rank 1 pokemons. why ? `(function() { return document.getElementsByClassName('form-control col-3 col-sm-2')[1].selectedIndex = '1';})();` this site is https://pokehubcoordinates.com/pvp – Emin Yalçın Sep 02 '21 at 10:37
  • What do you mean it works again? You'll need to debug this yourself. – amaitland Sep 02 '21 at 19:09
  • I am changing "select"-"option" on the site with this code I wrote. But it doesn't affect pokemon. – Emin Yalçın Sep 02 '21 at 20:51
  • Open the site in Chrome, open DevTools, get your JavaScript working there. Start with the basics, confirm you have the correct html element. – amaitland Sep 02 '21 at 21:23
  • my code is modifying the data in the combobox. so "#1" comes instead of "all". The html element I wrote is correct, but the pokemon don't change. same condition as above picture. – Emin Yalçın Sep 03 '21 at 00:16
  • Maybe you need generate change event by yourself. Check this: https://stackoverflow.com/a/28324400/18452174 – Victor Apr 26 '22 at 20:23

0 Answers0