I am unable to load https://www.abc.ca.gov/datport/lqs.html?rpttype=5 this URL using Java/Groovy to extract information from this webpage. It inloves Request using POST method. Please help to resolve.
Using InteliJIdea and Groovy.
JSoup and Groovy can easily load the page using this:
#Grab('org.jsoup:jsoup:1.7.1')
// The URL to scrape
String url = "https://www.abc.ca.gov/datport/lqs.html?rpttype=5"
// Connect and get URL via Jsoup
def doc = org.jsoup.Jsoup.connect(url).get()
// Output the entire HTML page
println doc
The table displayed on the page is retrieved with Ajax, and to retrieve that, you would need to parse the JSON from the request made with Javascript.
It might be easier for you to try using Geb, which can wait for the page beeing loaded with data, and then you can scrape it.
Related
I have created an image uploader on my site and store the URL in my MongoDB. I used this guide to create my image uploader: https://appdividend.com/2018/05/25/angular-6-file-upload-tutorial/
However, when the file is stored in my MongoDB table it is a C:\\fakepath\\ url. When I try to display the url in a background-image url field via ngStyle I get the response:
Cannot read property 'image' of undefined
Here is my code for the .html page:
<div class="jumbotron" [ngStyle]="{ 'background-image': 'url(' + post.image + ')'}"></div>
The rest of the code follows suit to the guide for storing the image.
If there is a way to either modify the url before it is in the MongoDB or to eliminate the C:\\fakepath\\ and just append the end to the ./upload/ folder where the image is stored should work as well. I have tried also just using the {{post.image}} syntax and recieve the same result.
Please check the network call if you're really receiving the data
(post and url) from backend.
If you are then check the logic where you assign the backend response to variable post.
From the error, it seems that post has no value. Or you accessing it
the wrong way. Check if post is yourCtrl.post or something.
How to pass parameters(envelope,PF and r ID) within iframe while returning URL in embedded docusigning? If I enter the POWERFORM link on browser I'm returning URL with the parameters (envelope,PF and r ID) but if I run code within iframe I'm unable to get the parameters. Please do assist me about this issue.
You are opening Powerform inside an IFrame, so the scope of the opened URL is inside the IFrame only and DocuSign cannot do anything to redirect the browser to come out of the IFrame. You have write a code on your end to capture the redirect URL and break the flow out of IFrame, you can find a similar query here. Normally DocuSign does not recommend using IFrame for Signing, also to capture the data like envelopeId, r Id etc, it is better to configure DocuSign Connect with a listener on your side. Using url redirect is a fragile solution as user might close the browser (or browser hangs/network issue) and you might lose the data. Whereas with DS Connect, DocuSign will publish the event to your listener and you will be able to capture all the required data in your listener.
<script>
function myFunction()
{
var x = document.getElementById("form1").action;
document.getElementById("demo").innerHTML = x;
}
</script>
This thing works for displaying the parameters.
window.parent.window.location.href = 'Parent URL' works to break out of an iframe and load the parent page.
I'm trying to display an Instagram feed on my website. I am not familiar with server side scripts. The explanations I have read go over my head.
I have managed to get an access key through Instagram but I don't know how to proceed.
I also tried the instructions from a video "How to implement an Instagram Feed in PHP without using the Instagram API"
For that, my php file works, displays the feed but I don't understand how to make it appear on my html page.
I'd be happy to make either method work.
In your HTML you should include a JavaScript 'script' element where you do something called an AJAX Request. The request will access the PHP file that produces the Instagram feed. ECHO the result from the PHP file and it will be returned into the DATA variable in the AJAX request. The request looks roughly like this:
$.ajax({
method: ‘POST or GET, most likely POST’,
url: ‘not always an actual url, this is the path to your PHP file’,
success: function(data) {
//php file returns into variable ‘data’
//display the feed within this function
}
});
The result from the PHP file should be echo’d back in JSON notation, if it isn’t, just add this to end of PHP the file:
$whatever = json_encode($your_result);
echo $whatever; //this is still the feed, just encoded in JSON
And if you need to decode it for some reason, just do
json_decode($variable_to_decode);
There are other parameters you can use in the AJAX request, like if for instance you need access to certain variables in your PHP file, that currently only exist in your HTML document.
this was solved by saving the html as php. i don't know why that is but it worked
I found SPWeb.SiteLogoUrl and expected this property in CSOM and REST. But I didn't find it. How can I get a SiteLogoUrl using CSOM or REST?
SP.js
Microsoft.SharePoint.Client.dll
It was moved to the POST request that SharePoint creates while redirecting via appredirect.aspx. So, the only one way to get Site Logo Url is to handle appredirect POST request.
To initiate redirect you should use this code snippet:
Response.Redirect(TokenHelper.GetAppContextTokenRequestUrl(sharePointHostUrl, Server.UrlEncode(targetUrl)));
ContextToken, SiteLogo, Url, Title and so on can be found in the POST FormData.
I am trying to create an html object dynamically with the necessary header information depending on the query string in the link I provide to Facebook. I am hoping that Facebook open graph will call this html link as I provided. However it seems that query string info are not getting passed to my server. Do anyone know how to make this work or what is the more appropriate way to do this. BTW, I am writing my code in Node.js.
To get more info about Facebook open graph api, look here, https://developers.facebook.com/docs/beta/opengraph/actions/.
For example, the link I am trying to pass to Facebook is, "http://xxx-url.com/getFacebookObject?objectId=&description=first dynamic post", so I sent a request with the link as, "https://graph.facebook.com/me/app-name:action-name?object=http://xxx-url.com/getFacebookObject?objectId=&description=first dynamic post". However, when I check the log on the server, I don't see anything in the query string.
Instead of using the query string, you can embed the data in the URL:
http://some-domain.com/getFacebookObject/id/description
Then, depending on what node.js packages you're using, extract the data from the request:
// expess.js style
app.get("/getFacebookObject/:id/:description", function(req, res) {
var id = req.params.id,
desc = req.params.description;
// your code...
});
(See http://expressjs.com/guide.html.)
Sorry, Facebook will strip off all query string information from the URL when they launch your site in the iframe. If it was a page tab app, then you could add it to the app_data query string parameters which in turn gets passed to your iframe's page tab app via the app_data part of the signed_request parameter.