Greasy Fork is available in English.

Pagetual

Автоматично извличане на следващите уеб страници с пагиниране и вмъкване в текущата страница за безкрайно превъртане. Поддържайте хиляди уеб сайтове без никакви правила.

< Отзив за Pagetual

Отзив: Отлично - скриптът работи

§
Публикуван на: 15.09.2024

I have a question.
example URL: https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q10150141230

Which selector is faster on "nextLink"?
#ans > div > div > div:nth-of-type(2) > div > [class*="ClapLv1Pagination_Chie-Pagination__Anchor--Next"]
#ans > div > div > div:nth-of-type(2) > div > a[class*="ClapLv1Pagination_Chie-Pagination__Anchor--Next"]
a[class*="ClapLv1Pagination_Chie-Pagination__Anchor--Next"]

Does this work like jquery?
Sorry but I am a beginner of programming.

Google translate

hoothinАвтор
§
Публикуван на: 16.09.2024

Fewer conditions generally lead to greater efficiency. Thus, No.3 may be the fastest, and fewer conditions are more likely to remain effective after changes to the document structure.

hoothinАвтор
§
Публикуван на: 16.09.2024

btw, browsers typically parse CSS selectors from right to left.

§
Публикуван на: 16.09.2024

Does browsers parse xpath from left to right?
Or Jquery?
css selector vs xpath vs jquery, Which is faster?
a[class*="ClapLv1Pagination_Chie-Pagination__Anchor--Next"]
vs.
//*[@id='ans']/div/div/div[2]/a[contains(@class, 'ClapLv1Pagination_Chie-Pagination__Anchor--Next')]

hoothinАвтор
§
Публикуван на: 16.09.2024

Yes, browsers parse XPath from left to right. But in most modern browsers, CSS selectors can be more efficient than XPath, unless the document is very large and the "ID/#" is close to the target element.

Публикувайте отговор

Влезте, за да публикувате отговор.