[HtmlUnit] [htmlunit:bugs] #2005 Polyfill webcomponentjs is not supported
RBRi via HtmlUnit-develop <[email protected]> Sat, 30 Mar 2019 14:00:17 -0000
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | </p/htmlunit/bugs/2005/f4c8926049ce775f54fd42a560e170f67dfd9452.bugs@htmlunit.p.sourceforge.net> |
This is a multi-part message in MIME format.
--===============1972820343070109634==
Content-Type: multipart/related;
boundary="===============7848937422950574364=="
This is a multi-part message in MIME format.
--===============7848937422950574364==
Content-Type: multipart/alternative;
boundary="===============2554128723727319264=="
MIME-Version: 1.0
--===============2554128723727319264==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
- **status**: open --> closed
- **assigned_to**: RBRi
- **Comment**:
This is an duplicate of https://github.com/HtmlUnit/htmlunit/issues/23. Will track the status on GitHub.
---
** [bugs:#2005] Polyfill webcomponentjs is not supported **
**Status:** closed
**Group:** 2.33
**Created:** Tue Dec 11, 2018 02:21 AM UTC by Ben Alex
**Last Updated:** Wed Dec 12, 2018 10:19 PM UTC
**Owner:** RBRi
I am attempting to scrape a third party web site which uses Polyfill.
As reported in https://sourceforge.net/p/htmlunit/bugs/1930/, HtmlUnit does not appear to support web pages that render Polyfill components.
The following minimal test (with HtmlUnit 2.33) illustrates the issue.
~~~java
import static com.gargoylesoftware.htmlunit.BrowserVersion.BEST_SUPPORTED;
import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.io.IOException;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;
import org.junit.Test;
public final class PolymerTest {
@Test
public void homePage() {
try (final WebClient wc = new WebClient(BEST_SUPPORTED)) {
wc.setAjaxController(new NicelyResynchronizingAjaxController());
final HtmlPage result = wc.getPage(
"http://webcomponents.github.io/hello-world-polymer/bower_components/hello-world-polymer/");
wc.waitForBackgroundJavaScript(10000);
wc.waitForBackgroundJavaScriptStartingBefore(10000);
assertThat(result.asText(), containsString("Hello Unicorn :)"));
} catch (final IOException ex) {
throw new IllegalStateException(ex);
}
}
}
~~~
Any advice much appreciated.
---
Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/htmlunit/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
--===============2554128723727319264==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit
<div class="markdown_content"><ul>
<li><strong>status</strong>: open --> closed</li>
<li><strong>assigned_to</strong>: RBRi</li>
<li><strong>Comment</strong>:</li>
</ul>
<p>This is an duplicate of <a href="https://github.com/HtmlUnit/htmlunit/issues/23." rel="nofollow">https://github.com/HtmlUnit/htmlunit/issues/23.</a> Will track the status on GitHub.</p>
<hr/>
<p><strong> <a class="alink strikethrough" href="https://sourceforge.net/p/htmlunit/bugs/2005/">[bugs:#2005]</a> Polyfill webcomponentjs is not supported </strong></p>
<p><strong>Status:</strong> closed<br/>
<strong>Group:</strong> 2.33<br/>
<strong>Created:</strong> Tue Dec 11, 2018 02:21 AM UTC by Ben Alex<br/>
<strong>Last Updated:</strong> Wed Dec 12, 2018 10:19 PM UTC<br/>
<strong>Owner:</strong> RBRi</p>
<p>I am attempting to scrape a third party web site which uses Polyfill.</p>
<p>As reported in <a href="https://sourceforge.net/p/htmlunit/bugs/1930/">https://sourceforge.net/p/htmlunit/bugs/1930/</a>, HtmlUnit does not appear to support web pages that render Polyfill components.</p>
<p>The following minimal test (with HtmlUnit 2.33) illustrates the issue.</p>
<div class="codehilite"><pre><span></span><span class="kn">import static</span> <span class="nn">com.gargoylesoftware.htmlunit.BrowserVersion.BEST_SUPPORTED</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">com.gargoylesoftware.htmlunit.WebClient</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">com.gargoylesoftware.htmlunit.html.HtmlPage</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">java.io.IOException</span><span class="o">;</span>
<span class="kn">import static</span> <span class="nn">org.hamcrest.CoreMatchers.containsString</span><span class="o">;</span>
<span class="kn">import static</span> <span class="nn">org.junit.Assert.assertThat</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">org.junit.Test</span><span class="o">;</span>
<span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="nc">PolymerTest</span> <span class="o">{</span>
<span class="nd">@Test</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">homePage</span><span class="o">()</span> <span class="o">{</span>
<span class="k">try</span> <span class="o">(</span><span class="kd">final</span> <span class="n">WebClient</span> <span class="n">wc</span> <span class="o">=</span> <span class="k">new</span> <span class="n">WebClient</span><span class="o">(</span><span class="n">BEST_SUPPORTED</span><span class="o">))</span> <span class="o">{</span>
<span class="n">wc</span><span class="o">.</span><span class="na">setAjaxController</span><span class="o">(</span><span class="k">new</span> <span class="n">NicelyResynchronizingAjaxController</span><span class="o">());</span>
<span class="kd">final</span> <span class="n">HtmlPage</span> <span class="n">result</span> <span class="o">=</span> <span class="n">wc</span><span class="o">.</span><span class="na">getPage</span><span class="o">(</span>
<span class="s">"http://webcomponents.github.io/hello-world-polymer/bower_components/hello-world-polymer/"</span><span class="o">);</span>
<span class="n">wc</span><span class="o">.</span><span class="na">waitForBackgroundJavaScript</span><span class="o">(</span><span class="mi">10000</span><span class="o">);</span>
<span class="n">wc</span><span class="o">.</span><span class="na">waitForBackgroundJavaScriptStartingBefore</span><span class="o">(</span><span class="mi">10000</span><span class="o">);</span>
<span class="n">assertThat</span><span class="o">(</span><span class="n">result</span><span class="o">.</span><span class="na">asText</span><span class="o">(),</span> <span class="n">containsString</span><span class="o">(</span><span class="s">"Hello Unicorn :)"</span><span class="o">));</span>
<span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="kd">final</span> <span class="n">IOException</span> <span class="n">ex</span><span class="o">)</span> <span class="o">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="n">IllegalStateException</span><span class="o">(</span><span class="n">ex</span><span class="o">);</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="o">}</span>
</pre></div>
<p>Any advice much appreciated.</p>
<hr/>
<p>Sent from sourceforge.net because [email protected] is subscribed to <a href="https://sourceforge.net/p/htmlunit/bugs/">https://sourceforge.net/p/htmlunit/bugs/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/htmlunit/admin/bugs/options.">https://sourceforge.net/p/htmlunit/admin/bugs/options.</a> Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>
--===============2554128723727319264==--
--===============7848937422950574364==--
--===============1972820343070109634==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============1972820343070109634==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
--===============1972820343070109634==--