Поиск [закрытого] синтаксического анализатора строки агента пользователя Java

Это должно работать:

.//button[.='OK' and not(ancestor::div[contains(@style,'display:none')])
and not(ancestor::div[contains(@style,'display: none')])]

РЕДАКТИРОВАНИЕ:

более простое и более эффективное выражение ниже:

//div[not(contains(@style,'display:none'))]//button[.='OK']

не работает правильно, потому что каждая кнопка имеет по крайней мере одно отделение, это видимо в его предках.

37
задан Bill 29 September 2009 в 16:26
поделиться

1 ответ

As far as I know (and why shouldn't I, it's one of the services company I used to work at provides with its products), detecting user agents when done properly is actually a good business in itself.

There are several free databases such as WURFL containing some rudimentary identification patterns for user agents but those mainly focus on for example mobile phones so in the end you may have to keep using the one you've made and just add the capability to import from/export to various related formats related to current state of user agent identification metadata.

If you're not going to steer away from desktop/PC world, you won't have much to worry about though since there's only four major layout engines out there with of course a set of versions with varying capabilities. The four big ones are the one in Trident in IE, Mozilla's Gecko, KDE's WebKit (at least in Safari and Chrome) and Opera's Presto.

4
ответ дан 27 November 2019 в 05:03
поделиться
Другие вопросы по тегам:

Похожие вопросы: