Java Selenium Web驱动程序拼写检查

Java Selenium Web驱动程序拼写检查,java,selenium-webdriver,Java,Selenium Webdriver,是否可以使用selenium webdriver对网页中显示的内容进行拼写检查。或者你能为同样的问题推荐任何API吗。 当做, Eliyas尝试使用谷歌API进行拼写检查。解决方案是针对java- (以下内容来自链接) 示例代码: SpellChecker checker = new SpellChecker(); SpellResponse spellResponse = checker.check( "helloo worlrd" ); for( SpellCorrection sc :

是否可以使用selenium webdriver对网页中显示的内容进行拼写检查。或者你能为同样的问题推荐任何API吗。 当做,
Eliyas

尝试使用谷歌API进行拼写检查。解决方案是针对java-

(以下内容来自链接)

示例代码:

SpellChecker checker = new SpellChecker();
SpellResponse spellResponse = checker.check( "helloo worlrd" );
for( SpellCorrection sc : spellResponse.getCorrections() )
System.out.println( sc.getValue() );
这将打印文本“helloo worlrd”的所有可用更正

还可以为请求设置更多选项

// Proxy settings
Configuration config = new Configuration();
config.setProxy( "my_proxy_host", 8080, "http" );

SpellChecker checker = new SpellChecker( config );
checker.setOverHttps( true ); // Use https (default true from v1.1)
checker.setLanguage( Language.ENGLISH ); // Use English (default)

SpellRequest request = new SpellRequest();
request.setText( "helloo helloo worlrd" );
request.setIgnoreDuplicates( true ); // Ignore duplicates

SpellResponse spellResponse = checker.check( request );

for( SpellCorrection sc : spellResponse.getCorrections() )
System.out.println( sc.getValue() );
更新: 找到了更多的拼写检查器:

  • 杰斯佩尔-
  • 乔托(免费)—
  • 爵士乐(免费)-

  • 请提供有关该场景的更多详细信息。是否存在C#等价API?我看到一些关于C#-,拼写检查的问题。