How to buffer results from a webpage to another? - html

I am using flask for my website.
I want to submit data using a form from my website to another website and then format the results page (an html page) before displaying it on the browser on my website.
After the form is submitted, the browser is directed to results page of that (another) website. Can I redirect again it to my site?
How to process the results page(call its html content as a string in code) ?

Sounds the process like this: user input the data -> your website get the data and post it to another website -> the website return a worked data -> your website receive this data, parse it and display it. I don't know you are familiar with API or not. If you are familiar with it you should know the process is just like using API. You just need to put all the process in a view and add_url_rule for it.

Related

How to display a customized webpage using Google Web App?

I'm trying to write a web app, such that when a user fetch his/her username to the web app, the web app will retrieve the data stored previously in a Google Sheet, and construct a form (webpage) based on the username. What I mean is, each username will have different contents to work with.
The problem is, I just cannot get the page to display; it just shows up for a second, and a warning sign just appears, and this makes my webpage looks so suspicious, while in fact, it isn't.
Here's the part of the code to show up the webpage:
The code above checks if it's the first time the user comes to the page, so a welcome page should be loaded, then he/she can continue from there.
And here's the page after a blink of an eyes:
What I want to ask is, is there a way that I can load a page based on the username given? I don't really know what I am doing wrong. :<
Thank you guys so much in advance.

Saving static HTML page generated with ReactJS

Background:
I need to allow users to create web pages for various products, with each page having a standard overall appearance. So basically, I will have a template, and based on the input data I need the HTML page to be generated for each product. The input data will be submitted via a web form, following which the data should be merged with the template to produce the output.
I initially considered using a pure templating approach such as Nunjucks, but moved to ReactJS as I have prior experience with the latter.
Problem:
Once I display the output page (by adding the user input to the template file with placeholders), I am getting the desired output page displayed in the browser. But how can I now obtain the HTML code for this specific page?
When I tried to view the source code of the page, I see the contents of 'public/index.html' stating:
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expectedly, the same happens when I try to save (Save As...) the html page via the browser. I understand why the above happens.
But I cannot find a solution to my requirement. Can anyone tell me how I can download/save the static source code for the output page displayed on the browser.
I have read possible solutions such as installing 'React/Redux Development Extension' etc... but these would not work as a solution for external users (who cannot be expected to install these extensions to use my tool). I need a way to do this on production environment.
p.s. Having read the "background" info of my task, do let me know if you can think of any better ways of approaching this.
Edit note:
My app is currently actually just a single page, that accepts user data via a form and displays the output (in a full screen dialog). I don't wish to have these output pages 'published' on the website, and these are simply to be saved/downloaded for internal use. So simply being able to get the "source code" for the dislayed view/page on the browser and saving this to a file would solve my problem. But I am not sure if there is a way to do this?
Its recommended that you use a well-known site generator such as Gatsby or Next for your static sites since "npx create-react-app my-app" is for single page apps.
(ref: https://reactjs.org/docs/create-a-new-react-app.html#recommended-toolchains)
If I'm understanding correctly, you need to generate a new page link for each user. Each of your users will have their own link (http/https) to share with their users.
For example, a scheduling tool will need each user to create their own "booking page", which is a generated link (could be on your domain --> www.yourdomain.com/bookinguser1).
You'll need user profiles to store each user's custom page, a database, and such. If you're not comfortable, I'll use something like an e-commerce tool that will do it for you.
You can turn on the debugger (f12) and go to "Elements"
Then right-click on the HTML tag and press edit as HTML
And then copy everything (ctrl + a)

Brigde HTML login with Json

I want to write a HTML webpage, which can be used to login to another already existing website. It is secured by a json login section. I want to send the data entered into my website to the second website and receive the answer. Is this possible to do ?
You can use web service or javascript fot this work.

Single Page Application AngularJS Master Detail

I'm building a single page application using AngularJS. I want it to have a master detail appearance. Where there is a list on the side and a main view on the rest of the page showing the information for that list element.
I was wondering whether the correct way to approach this would be to use ng-route? Using ng-route I presume that I would have a url such as '/:elem' and a template url which then would display the information for that element using routeParams.
I'm having a bit of trouble just working out how all the server calls work. I have separate services for the API and the UI. So are the server calls like this:
The user navigates to my webpage and all the .html files are returned, including the template html files, but with no data apart from just the list of elements.
When the user clicks one of the elements, then another call is done to the server to retrieve the data for that element.
Thank you.

Parsing HTML with TFHpple on iOS

I am working on an iOS project and my goal is to create a "pretty" app version of a specific website. To do this, I'm parsing all the data from said website with TFHpple for use in my app.
This website has a store, so my goal was to read the webpage with the products, then display them all in a table view and what not. However, the website doesn't display all the products on the specific page at once.
It splits up the products across 3 pages inside the one website page so you have to click the "next page" button on the website, and that runs some javascript code and adds the "?foo" part to make the URL in the browser be "http://www.domain.com/page?foo". I read up that this "?foo" is a query string, however I don't know how I would trigger this in my Objective-C code from the base "http://www.domain.com/page" page.
So simply, I can't grab all the items I would like to with TFHpple because some are not in the HTML until the correct query string is used.
I'm not really sure if I am explaining my predicament very clearly, but if anyone has any info that I could use I would appreciate it immensely!
I am working on a similar project. I think your problem has nothing to do with TFHpple. TFHpple only handles HTML parsing rather than data downloading from server. My approach is like this:
NSInteger currentPageIndex=1;
NSString *dataUrlString=[NSString stringWithFormat:#"http://www.domain.com/page?index=%d",currentPageIndex];
Detecting tableView's scrolling event, if it reaches the end of the tableView, then load next page data from server;
Parse the new page's HTML data from server, append data to tableView's datasource and reload the tableView.