lundi 28 janvier 2019

Firebase - How to get the child of child of child and display into the HTML table?

Firebase Database Image. Please click here to have a look I would like to get the data of name, phone number, foodName and quantity and show it in my HTML table. But I have no idea how to get it since I'm a beginner.

var rootRef = firebase.database().ref().child("Requests");

rootRef.on("child_added", snap => {

var name = snap.child("name").val();

var phone = snap.child("phonenumber").val();

var foodname = snap.child("foodName").val();

var quantity = snap.child("quantity").val();

}

I expect I will able to get the data of name, phonenumber, foodName and quantity and display to my HTML table.




Can I open url on opera from console?

Ok, I need to open URL from console in opera (not standart browser), and can I use this command to write bash script (Ir is would be like a shortcut)?




Get statistics from wordpress to laravel

I have a lot of Wordpress websites running.

What i want to create is a Laravel website with an overview of all my Wordpress websites, including information as (in the beginning) username and password and the website url, and for later moment more information about the installed plugins or last changes on the website.

At the end it has to be somewhat automatically updating.

Any ideas to create something like this?




How to bypass alert/dialog authentication in POST request?

So, when I try to consume certain API i got this screen

screen from the Correios API

I want to know if there's a way I can send this "username" and "password" through postman or javascript.

When I try to use postman i get 401 unauthorized

postman request unauthorized




Can I stream a unity project to webRTC?

I am trying to stream my unity project using WebRTC, is that possible and if so, how do I implement it?




Why does .on() not see to call its function when the subtree is modified?

Im working on an in-browser (very basic) chat. I have jquery code

    $("#msgs").on("DOMSubtreeModified", function() {
        location.reload()
    });

and i need to refresh the page when the div msgs has another

added to it.

Why is this code not doing so?

I've tried MutationObserver as well

the repl for those that want to test it: https://repl.it/@aceharvey/hy-chat




Scraping AJAX e-commerce site using python

I have a problem on scraping an e-commerce site using BeautifulSoup. I did some Googling but I still can't solve the problem.

Please refer on the pictures:

1 Chrome F12 : https://scontent.fkul7-1.fna.fbcdn.net/v/t1.0-9/50874003_2100628179980272_838265414453559296_n.jpg?_nc_cat=105&_nc_ht=scontent.fkul7-1.fna&oh=610394bf4ee663dc54b71b1084654666&oe=5CB32DB8

[2] Result : https://scontent.fkul7-1.fna.fbcdn.net/v/t1.0-9/50713161_2100628126646944_8588520010161324032_o.jpg?_nc_cat=105&_nc_ht=scontent.fkul7-1.fna&oh=e2caf3fae70e66690fdcadcfe3da3d0e&oe=5CBB6B16

Here is the site that I tried to scrape: "https://shopee.com.my/search?keyword=h370m"

Problem:

  1. When I tried to open up Inspect Element on Google Chrome (F12), I can see the for the product's name, price, etc. But when I run my python program, I could not get the same code and tag in the python result. After some googling, I found out that this website used AJAX query to get the data.

  2. Anyone can help me on the best methods to get these product's data by scraping an AJAX site? I would like to display the data in a table form.

My code: import requests from bs4 import BeautifulSoup source = requests.get('https://shopee.com.my/search?keyword=h370m') soup = BeautifulSoup(source.text, 'html.parser') print(soup)