Related
it is possible to customize the template of the tree base header (the column which contains the "+" and "-" icon when the grouping is active ) ?
I want to modify the content of the blank cells and display inside them a row number ({{row.grid.renderContainers.body.visibleRowsCache.indexOf(row)}}) ...
I found the content of the template I need to modify:
<i ng-class="
{ 'ui-grid-icon-minus-squared':
(
(grid.options.showTreeExpandNoChildren && row.treeLevel > -1)
|| (row.treeNode.children && row.treeNode.children.length > 0)
) && row.treeNode.state === 'expanded',
'ui-grid-icon-plus-squared':
(
(grid.options.showTreeExpandNoChildren && row.treeLevel > -1)
|| ( row.treeNode.children && row.treeNode.children.length > 0)
)
&& row.treeNode.state === 'collapsed'
}"
ng-style="{'padding-left': grid.options.treeIndent * row.treeLevel + 'px'}"
class="ui-grid-icon-minus-squared" style="padding-left: 10px;">
</i>
...but I don't see how to change it and store my modification in the gridOption
Yes, it is possible. I needed the same thing. While searching I found this thread. This mentions that you can override templates by feeding the templateCache. (I used the accepted method (using script tag).) For this I just needed the reference of the template which I wanted to override, so "ui-grid/treeBaseRowHeaderButtons". For my case I inserted a row count number before the icon. The code I placed in my view's html:
<script id="ui-grid/treeBaseRowHeaderButtons" type="text/ng-template">
<div class="ui-grid-tree-base-row-header-buttons" ng-class="{'ui-grid-tree-base-header': row.treeLevel > -1 }" ng-click="treeButtonClick(row, $event)">
<span class="countNumber">{{ row.entity.count }}</span>
<i ng-class="{'ui-grid-icon-minus-squared': ( ( grid.options.showTreeExpandNoChildren && row.treeLevel> -1 ) || ( row.treeNode.children && row.treeNode.children.length > 0 ) ) && row.treeNode.state === 'expanded', 'ui-grid-icon-plus-squared': ( ( grid.options.showTreeExpandNoChildren && row.treeLevel > -1 ) || ( row.treeNode.children && row.treeNode.children.length > 0 ) ) && row.treeNode.state === 'collapsed'}"
ng-style="{'padding-left': grid.options.treeIndent * row.treeLevel + 'px'}">
</i>
</div>
</script>
I have a ng-repeat that builds a table from a web service. I render 6 values like this: med:1 lab:1 pl:1 in one cell. I need to make a decision based on those 6 values. My ng-repeat code is like this:
<tr ng-repeat="(pid, value) in patient|groupBy:'pid'">
<td>{{pid}}</td>
<td ng-repeat="(disease, value) in patient|groupBy:'name'">
<span ng-repeat="item in value|filterBy:['pid']:pid" ng-model="disease-conditial">
{{item.src}}:{{item.total}}
</span>
<!--This is the code that I'm trying to make to work-->
<span class="label label-danger" ng-show="
(item.src == 'med' and item.total > 0) and
(item.src == 'lab' and item.total > 0 and
(item.src == 'pl' and item.total > 0))">Yes
</span>
</td>
</tr>
Please consider this sudo code. I need three conditions:
if src == med && total > 0
and
if src == lab && total > 0
and
if src == pl && total > 0
then Yes
if src == med && total == 0
if src == lab && total > 0
if src == pl && total > 0
then Maybe
if src == med && total == 0
if src == lab && total == 0
if src == pl && total == 0
then No
I was reading about ng-switch but this directive doesn't support conditionals with dynamic data $scope.something == 1
Does Angular has any built in directive where I can achieve this?
The data in the cell looks like this:
+-----------------+
|med:1 lab:1 pl:1 |
+-----------------+
I need to evaluate the value of med && the value of lab && the value of pl to make the decision of Yes, Maybe, No.
Update 7 SEP 2016
The data that comes from the object is as follow:
Array[50]
0:Object
$$hashKey:"object:18"
name:"Alcoholism"
pid:"1"
src:"lab"
total:"1"
__proto__:Object
1:Object
$$hashKey:"object:19"
name:"Alcoholism"
pid:"1"
src:"med"
total:"1"
__proto__:Object
2:Object
$$hashKey:"object:20"
name:"Alcoholism"
pid:"1"
src:"pl"
total:"0"
__proto__:Object
Once again, scenario 1. if med > 0 && lab >0 && pl >0 then Yes. Scenario 2. if med == 0 && lab > 0 && pl > 0 then Maybe. Scenario 3. if med == 0 && lab == 0 && pl == 0 then No.
You can use a ng-switch with item.src like this:
<div class="animate-switch-container" ng-switch on="item.src" ng-show="item.total > 0">
<div ng-switch-when="med">med</div>
<div ng-switch-when="lab">lab</div>
<div ng-switch-when="pl">pl</div>
</div>
With the ng-show in the entire div will make the same and validation.
I ill prefer you to get single value from controller which you want to display on view but ng-bind can also help you render required data
<span class="label label-danger" ng-bind="item.total>0 && (item.src === 'med' || item.src === 'lab' || item.src === 'pl')?'yes':'no'"> </span>
I think you are just putting your conditions wrong. I'm doing some guessing here, but what I think you are trying to do is this:
<tr ng-repeat="(pid, value) in patient|groupBy:'pid'">
<td>{{pid}}</td>
<td ng-repeat="(disease, value) in patient|groupBy:'name'">
<span ng-repeat="item in value|filterBy:['pid']:pid" ng-model="disease-conditial">
{{item.src}}:{{item.total}}
</span>
<!--This is the code that I'm trying to make to work-->
<span class="label label-danger" ng-show="
((item.src == 'med' || item.src == 'lab' || item.src == 'pl') and item.total > 0)">
Yes
</span>
<span class="label label-danger" ng-show="
((item.src == 'med' && item.total == 0) || (item.src == 'lab' and item.total > 0) || (item.src == 'pl' and item.total > 0))">
Maybe
</span>
<span class="label label-danger" ng-show="
((item.src == 'med' || item.src == 'lab' || item.src == 'pl') and item.total == 0)">
No
</span>
</td>
</tr>
It is not a problem with the ng-show directive, it is a problem with the conditions inside it.
I have the following code running with angular v1.4.7
<img ng-repeat="x in modules" style="float:left" ng-src="{{moduleImagePath(x)}}"/>
The images paths are created by moduleImagePath(x) This function basically switches an image from a good status to a error status image which has _ERR appended to the image name:
$scope.moduleImagePath= function(item)
{
var name = item.name
if (item.idx === 0)
name = 'Master'
if (item.isLost === 1 || item.state != 'Op')
{
return 'img/' + name + '_ERR.jpg'
}
else
{
return 'img/' + name + '.jpg'
}
}
When the view is displayed, a timer starts polling for a json update that contains the modules data. Normally it is on a 500ms timer, however for debug I have made it 10 seconds.
The images never appear on screen, chrome inspector states that the images are loading but they are never requested at the webserver. They remain as "pending indefinitely:
Master.jpg (pending) Other 0 B Pending
Master_ERR.jpg (pending) Other 0 B Pending
EL1124.jpg (pending) Other 0 B Pending
EL1124_ERR.jpg (pending) Other 0 B Pending
EL4024.jpg (pending) Other 0 B Pending
EL4024_ERR.jpg (pending) Other 0 B Pending
EL2624.jpg (pending) Other 0 B Pending
EL2624_ERR.jpg (pending) Other 0 B Pending
EL4008_ERR.jpg (pending) Other 0 B Pending
EL4008.jpg (pending) Other 0 B Pending
The webserver is mongoose embedded in a C program running on localhost.
If I use the following code it works but of course needs to be handwritten for every use case:
<div ng-if="x.name == 'Master' && x.isLost === 0"> <img src="img/Master.jpg"/></div>
<div ng-if="x.name == 'Master' && x.isLost === 1"> <img src="img/Master_Err.jpg"/></div>
<div ng-if="x.name == 'EK1100' && x.isLost === 0"> <img src="img/EK1100.jpg"/></div>
<div ng-if="x.name == 'EK1100' && x.isLost === 1"> <img src="img/EK1100_Err.jpg"/></div>
<div ng-if="x.name == 'EL1124' && x.isLost === 0"> <img src="img/EL1124.jpg"/></div>
<div ng-if="x.name == 'EL1124' && x.isLost === 1"> <img src="img/EL1124_Err.jpg"/></div>
<div ng-if="x.name == 'EL2624' && x.isLost === 0"> <img src="img/EL2624.jpg"/></div>
<div ng-if="x.name == 'EL2624' && x.isLost === 1"> <img src="img/EL2624_Err.jpg"/></div>
<div ng-if="x.name == 'EL4008' && x.isLost === 0"> <img src="img/EL4008.jpg"/></div>
<div ng-if="x.name == 'EL4008' && x.isLost === 1"> <img src="img/EL4008_Err.jpg"/></div>
<div ng-if="x.name == 'EL4024' && x.isLost === 0"> <img src="img/EL4024.jpg"/></div>
<div ng-if="x.name == 'EL4024' && x.isLost === 1"> <img src="img/EL4024_Err.jpg"/></div>
It seems like the resources need to be pre-loaded before I can switch them around. Should this be done via css or another method?
I don't see any issues with your angularjs code.but you just to resolve your problem you can try out this way.
create an ng-switch just for x.isLost ( i know it is just a bool.still i prefer to use ng-switch instead of ng-if)
<div ng-switch on="x.isLost">
<img src="img/{{x.name}}.jpg" ng-switch-when="0"/>
<img src="img/{{x.name}}_ERR.jpg" ng-switch-when="1"/>
</div>
And just to check, are you running your webpage through localhost or your ipaddress ? sometimes when i try to access my webpage using by my IP i run into such kind of issues.
I use Apache CXF in some bundle A to call video from http://www.movingimage24.com/ in my Portal A. this works fine, the videos can be called from movingimage24 and displayed in my Portal A without problem.
Now when I use Apache CXF in some Bundle B on the same way like in Bundle A, and try to call the video in my portal B, the following exception is thrown:
ERROR [0:0:0:0:0:0:0:1 [1416678184971] GET /content/portal/de/home/company/test_videomanager.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDebugFilter Exception: loader constraint
violation in interface itable initialization: when resolving method "javax.xml.bind.helpers.AbstractMarshallerImpl.setAttachmentMarshaller(Ljavax/xml/bind/attachment/AttachmentMarshaller;)V"
the class loader (instance of org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5) of the current class, javax/xml/bind/helpers/AbstractMarshallerImpl, and the class loader (instance
of org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5) for interface javax/xml/bind/Marshaller have different Class objects for the type javax/xml/bind/attachment/AttachmentMarshaller
used in the signature java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "javax.xml.bind.helpers.AbstractMarshallerImpl.setAttachmentMarshaller
(Ljavax/xml/bind/attachment/AttachmentMarshaller;)V" the class loader (instance of org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5) of the current class, javax/xml/bind/helpers/AbstractMarshallerImpl,
and the class loader (instance of org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5) for interface javax/xml/bind/Marshaller have different Class objects for the type javax/xml/bind/attachment/AttachmentMarshaller
used in the signature
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createMarshaller(JAXBContextImpl.java:776)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.createMarshaller(JAXBContextImpl.java:142)
at org.apache.cxf.jaxb.io.DataWriterImpl.createMarshaller(DataWriterImpl.java:120)
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:212)
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:114)
at org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor.handleMessage(RPCOutInterceptor.java:94)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
at de.company.acd.company.cq.webservice.OsgiAwareClientImpl.invoke(OsgiAwareClientImpl.java:62)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:377)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:330)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
at $Proxy139.getHttpsPlayerCodeForLockedVideo(Unknown Source)
...
...........
at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:249)
at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.felix.http.proxy.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.sling.launchpad.base.webapp.SlingServletDelegate.service(SlingServletDelegate.java:277)
at org.apache.sling.launchpad.webapp.SlingServlet.service(SlingServlet.java:150)
at com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.java:228)
at com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:315)
at com.day.j2ee.servletengine.FilterChainImpl.doFilter(FilterChainImpl.java:74)
at com.day.crx.launchpad.filters.CRXLaunchpadLicenseFilter.doFilter(CRXLaunchpadLicenseFilter.java:96)
at com.day.j2ee.servletengine.FilterChainImpl.doFilter(FilterChainImpl.java:72)
at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:334)
at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:378)
at com.day.j2ee.servletengine.ServletHandlerImpl.execute(ServletHandlerImpl.java:315)
at com.day.j2ee.servletengine.DefaultThreadPool$DequeueThread.run(DefaultThreadPool.java:134)
at java.lang.Thread.run(Thread.java:662)
my pom.xml for bundle B looks like this:
> > <plugins>
> <plugin>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-codegen-plugin</artifactId>
> <version>${apache.cxf.version}</version>
> <executions>
> <execution>
> <id>generate-sources</id>
> <phase>generate-sources</phase>
> <configuration>
> <defaultOptions>
> <autoNameResolution>true</autoNameResolution>
> </defaultOptions>
> <sourceRoot>${project.build.directory}/cxf-generated</sourceRoot>
> <extension>true</extension>
> <wsdlOptions>
> <wsdlOption>
> <wsdl>${basedir}/src/main/resources/wsdl/VideoManager/VideoManager.wsdl</wsdl>
> </wsdlOption>
> </wsdlOptions>
> <sources>
> <source>${project.build.directory}/cxf-generated</source>
> </sources>
> </configuration>
> <goals>
> <goal>wsdl2java</goal>
> </goals>
> </execution>
> </executions>
> </plugin> <plugin>
> <groupId>org.apache.felix</groupId>
> <artifactId>maven-bundle-plugin</artifactId>
> <extensions>true</extensions>
> <version>2.3.7</version>
> <configuration>
> <instructions>
> <Import-Package>
> javax.activation;version=1.1.0,
> javax.xml.bind.*;
> com.adobe.xmp,
> org.apache.cxf.jaxb.*;
> com.day.commons.datasource.poolservice,
> com.day.cq.commons.jcr,
> com.day.cq.dam.api,
> com.day.cq.dam.commons.metadata,
> com.day.cq.dam.commons.process,
> com.day.cq.dam.core,
> com.day.cq.jcrclustersupport,
> com.day.cq.replication,
> com.day.cq.search,
> com.day.cq.search.result,
> com.day.cq.security,
> com.day.cq.wcm.api,
> com.day.cq.wcm.api.components,
> com.day.cq.wcm.api.designer,
> com.day.cq.wcm.foundation,
> com.day.cq.workflow,
> com.day.cq.workflow.exec,
> com.day.cq.workflow.model,
> com.day.cq.workflow.metadata,
> com.day.text,
> javax.crypto,
> javax.crypto.spec,
> javax.imageio,
> javax.imageio.metadata,
> javax.imageio.stream,
> javax.jcr,
> javax.jcr.nodetype,
> javax.jcr.query,
> javax.jcr.lock,
> javax.jcr.version,
> javax.jws,
> javax.jws.soap,
> javax.servlet,
> javax.servlet.http,
> javax.sql,
> javax.xml.bind,
> javax.xml.bind.annotation,
> javax.xml.bind.annotation.adapters,
> javax.xml.datatype,
> javax.xml.namespace,
> javax.xml.parsers,
> javax.xml.transform,
> javax.xml.transform.stream,
> javax.xml.ws,
> com.day.cq.commons,
> org.apache.commons.codec,
> org.apache.commons.codec.binary,
> org.apache.commons.codec.net,
> org.apache.commons.collections,
> org.apache.commons.dbutils,
> org.apache.commons.dbutils.handlers,
> org.apache.commons.httpclient,
> org.apache.commons.httpclient.auth,
> org.apache.commons.httpclient.methods,
> org.apache.commons.httpclient.params,
> org.apache.commons.lang,
> org.apache.commons.lang.builder,
> org.apache.commons.lang.time,
> org.apache.commons.logging,
> org.apache.sling.api,
> org.apache.sling.api.request,
> org.apache.sling.api.resource,
> org.apache.sling.api.scripting,
> org.apache.sling.api.servlets,
> org.apache.sling.commons.json,
> org.apache.sling.commons.json.io,
> org.apache.sling.event.*,
> org.apache.sling.jcr.api,
> org.apache.sling.jcr.resource,
> org.apache.sling.settings,
> org.jdom,
> org.jdom.output,
> org.jdom.input,
> org.osgi.framework,
> org.osgi.service.component,
> org.osgi.service.cm,
> org.slf4j,
> org.w3c.dom,
> org.xml.sax,
> org.xml.sax.helpers,
> *;resolution:=optional
> </Import-Package>
> <Embed-Dependency>
> cxf-bundle;inline=true,
> jaxb-api,
> jaxb-xjc,
> jaxb-impl,
> jaxb-core,
> velocity;groupId=org.apache.velocity;artifactId=velocity;scope=compile,
> activation;version=1.1,
> xmlschema-core,
> spring-beans,
> spring-core,
> neethi,
> wsdl4j,
> </Embed-Dependency>
>
> <!-- CXF Dependencies -->
> <dependencies> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-frontend-jaxws</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-transports-http</artifactId>
> <version>${apache.cxf.version}</version>
> <scope>compile</scope>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-frontend-simple</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-core</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-api</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-bindings-soap</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>org.apache.ws.xmlschema</groupId>
> <artifactId>xmlschema-core</artifactId>
> <version>2.0.3</version>
> </dependency>
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-beans</artifactId>
> <version>3.0.6.RELEASE</version>
> </dependency>
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-core</artifactId>
> <version>3.0.6.RELEASE</version>
> </dependency>
> <dependency>
> <groupId>org.apache.neethi</groupId>
> <artifactId>neethi</artifactId>
> <version>3.0.1</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-databinding-jaxb</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency>
> <dependency>
> <groupId>wsdl4j</groupId>
> <artifactId>wsdl4j</artifactId>
> <version>1.6.2</version>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-tools-common</artifactId>
> <version>${apache.cxf.version}</version>
> <exclusions>
> <exclusion>
> <groupId>commons-lang</groupId>
> <artifactId>commons-lang</artifactId>
> </exclusion>
> </exclusions>
> </dependency>
> <dependency>
> <groupId>org.apache.cxf</groupId>
> <artifactId>cxf-rt-ws-addr</artifactId>
> <version>${apache.cxf.version}</version>
> </dependency> </dependencies>
I am new to Apache CXF and hope somebody can help me.
I want to parse the page (https://www.google.com/flights/#search;f=JFK;t=SFO;d=2014-12-22;r=2014-12-30) on my backend using needleJs(https://github.com/tomas/needle) and Cheerio(https://github.com/cheeriojs/cheerio).
When I tried to request the google.flight page by the url, what I got is
> <!DOCTYPE html> <html><head><meta http-equiv="content-type"
> content="text/html; charset=UTF-8"><meta name="flights::gwt:property"
> content="baseUrl=/flights/static/"><title>Flights - Google
> Search</title> <meta name="description" content="Choose your flight
> from a simple list of results, explore destinations on a map, and find
> travel dates with the lowest fare with Flight Search."><script
> language="javascript" type="text/javascript"> var __JS_ILT__ = new
> Date(); </script> <style
> type="text/css">#gbar,#guser{font-size:13px;padding-top:1px
> !important;}#gbar{height:22px}#guser{padding-bottom:7px
> !important;text-align:right}.gbh,.gbd{border-top:1px solid
> #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}#media
> all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline
> !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27
> !important}.gbf .gb4{color:#900 !important}</style><script
> language="javascript" type="text/javascript"> var __JS_INI__ =
> "[,[,[,[1275,1105,1266,1174,1144,1203,15,16,10]],[,\42USD\42,\42$\42,\42\\u00a4#,##0\42,\42\\u00a4#,##0.00\42,\42#,##0\42,1],[,2,1609.344,\42#,##0\42,\42#,##0.0\42],[,2,2.54,\42#,##0\42],\42google-travel\42,\42typeId:72275\42,\42ADS25WNJCodY_Q5E8phMiFpRv5Mjahv3VPknsbbucoHBj4CEkSDnkC31pFues4Idsta-tlsZHS3HRUa2nBAqRARRiSySmvbRZymx5Q\42,\42.com\42,\42en\42,\42US\42,1,,,,,,\42https://accounts.google.com/ServiceLogin?continue\\u003d_CONTINUE_\42],[,\42BOS\42,\42Boston\42,42.3644444,-71.005278,[\42BOS\42,\42PSM\42],[\42BOS\42],\42United
> States\42,\42MA\42,\42US\42,\42Massachusetts\42,,42.3584308,-71.0597732],[[,\42BOS\42,\42Boston
> Logan International\42,\42Boston\42,\42BOS\42,\42United
> States\42,42.3644444,-71.005278,\42MA\42,\42US\42]],[[,\42ONEWORLD\42,\42Oneworld\42],[,\42SKYTEAM\42,\42SkyTeam\42],[,\42STAR_ALLIANCE\42,\42Star
> Alliance\42]],,[[,\42_fli\42,\42Flights\42],[,\42_mor\42,\42More\42],[,\42_web\42,\42Web\42],[,\42#map\42,\42Maps\42],[,\42nws\42,\42News\42],[,\42shop\42,\42Shopping\42],[,\42isch\42,\42Images\42],[,\42vid\42,\42Videos\42],[,\42bks\42,\42Books\42],[,\42app\42,\42Apps\42]],1,,\42US
> Dollar\42,0]"; </script> <script>(function(){var
> gs=document.createElement('script');var wmm=window.matchMedia;var
> hires=!!wmm && !wmm('(-webkit-device-pixel-ratio:1.0)').matches &&
> !wmm('(-moz-device-pixel-ratio:1.0)').matches;gs.src=!hires?'static/D4C5482E0AEB161B751BBFC9C57F4C0D.cache.js':'static/7521F8CC51FAFDF1C1478664FF1CF4BD.cache.js';gs.type='text/javascript';gs.async=true;document.getElementsByTagName('head')[0].appendChild(gs);})();</script><script
> language="javascript" type="text/javascript"></script> <link
> rel="shortcut icon" href="/favicon.ico"/><meta name="google"
> value="notranslate"></head><body> <script language="javascript"
> type="text/javascript">(function() { var script =
> document.createElement('script'); script.type = 'text/javascript';
> script.src = 'https://ssl.gstatic.com/feedback/api.js';
> document.body.appendChild(script);})();</script> <div id=gbar><nobr><a
> class=gb1 href="https://www.google.com/search">Search</a> <a class=gb1
> href="https://www.google.com/search?hl=en&tbm=isch&source=og">Images</a>
> <a class=gb1 href="https://maps.google.com/maps?hl=en">Maps</a> <a
> class=gb1 href="https://play.google.com/?hl=en">Play</a> <a class=gb1
> href="https://www.youtube.com/results">YouTube</a> <a class=gb1
> href="https://news.google.com/nwshp?hl=en">News</a> <a class=gb1
> href="https://mail.google.com/mail/">Gmail</a> <a class=gb1
> href="https://drive.google.com/">Drive</a> <a class=gb1
> style="text-decoration:none"
> href="http://www.google.com/intl/en/options/"><u>More</u>
> »</a></nobr></div><div class=gbh style=left:0></div><div
> class=gbh style=right:0></div><div id="_BrowserWarning_"
> style="border:1px solid
> #FFE475;background-color:#FEF7CB;padding:4px;text-align: center;color: #222;">Google Flight Search has not been optimized for your browser. For best results, please try Chrome, Firefox 3.5+, Internet Explorer
> 8+, Safari 4+.<a href="#" style="color: #222;"
> onclick="document.getElementById('_BrowserWarning_').style.display='none';
> return false;"> Close</a></div><div id="root"></div></body></html>
Which is not the page I want.
For performance purpose, I guess the reason is that Google tries to dump a very small size of html when I request. And there are a few necessary javascript codes in the html which will be executed after the DOM loaded. And then those script will fetch the fares and render them. Correct me if I am wrong.
So what can I do in order to parse the right page by the url for the Google flight site??
Thanks.
You could use https://developers.google.com/qpx-express/faq#q1 instead. There is a free daily quota.