'#12768949' is not a valid hex color google geochart - google-visualization

Whenever I try to add google geochart to my website the chart looks like this:
.
And I get an error that says #12768949' is not a valid hex color. If I try it on an empty
react project it works like on the official site.
Does someone know what the issue might be?
What I tried so far: removed bootstrap, removed my app.css file
The only time it works is when no other components are rendered...

Related

WebKitGtk doesn't load local files

I've tried loading a local html file using webkit_web_view_load_uri() with a file:// URL. However, the webview would display a blank page. To circumvent this, I tried using webkit_web_view_load_html() and it worked correctly.
Now that I'm trying to load some images in the html using the <img> tag, the images aren't loaded (It displays a blank page).
I'm puzzled because I tried before (~ 2 months ago) a similar method and it worked.
Note: I copied the contents of the generated HTML into a file and loaded it with Firefox and it worked as it should (The images are visible), but with another WebKitGtk application I had lying around the images didn't load.
Note: I'm using C++ as the main programming language (I'd prefer having C++ types in the solutions only if possible)
Note: I have set webkit_settings_set_allow_file_access_from_file_urls() and webkit_settings_set_allow_universal_access_from_file_urls() to TRUE
Ok, I've managed to solve this. The solution had NOTHING to do with webkitgtk, which is strange. It seems that the application was trying to download the page instead of loading it. This traces to a faulty MIME type database.
Tl;Dr:
Execute this:
rm ~/.local/share/mime/packages/user-extension-html.xml
update-mime-database ~/.local/share/mime
and use webkit_web_view_load_uri() instead of webkit_web_view_load_html() with a file:// URI
I had the same problem in C. You have to explicitly set file:// as base_uri when you call webkit_web_view_load_html().
See also answer here

content empty when using scrapy

Thanks for everyone in advance.
I encountered a problem when using Scrapy on Python 2.7.
The webpage I tried to crawl is a discussion board for Chinese stock market.
When I tried to get the first number "42177" just under the banner of this page (the number you see on that webpage may not be the number you see in the picture shown here, because it represents the number of times this article has been read and is updated realtime...), I always get an empty content. I am aware that this might be the dynamic content issue, but yet don't have a clue how to crawl it properly.
The code I used is:
item["read"] = info.xpath("div[#id='zwmbti']/div[#id='zwmbtilr']/span[#class='tc1']/text()").extract()
I think the xpath is set correctly and I have checked the return value of this response and it indeed told me that there is nothing under this directory. Results shown here:'read': [u'<div id="zwmbtilr"></div>']
If it has something, there should be something between <div id="zwmbtilr"> and </div>.
Really appreciated if you guys share any thoughts on this!
I just opened your link in Firefox with NoScript enabled. There nothing inside the <div #id='zwmbtilr'></div>. If I enable the javascripts, I can see the content you want. So, as you already new, it is a dynamic content issue.
Your first option is try to identify the request generated by javascript. If you can do that, you can send the same request from scrapy. If you can't do it, the next option is usually to use some package with javascript/browser emulation or someting like that. Something like ScrapyJS or Scrapy + Selenium.

Find and click links in ugly table with Python and Selenium webdriver

I'm trying to get Selenium Webdriver to click x number of links in a table, and I can't get it to work. I can print the links like this:
links = driver.find_elements_by_xpath("//table[2]/tbody/tr/td/p/strong/a")
for i in range(0,len(links)):
print links[i].text
But when I try to do a links[i].click() instead of printing, python throws me an error.
The site uses JSP and the hrefs of the links looks like this "javascript:loadTestResult(169)"
This is a sub/sub-page and not possible to access by direct URL, and the table containing the links are very messy and large so instead of pasting the whole source here I saved the page on this url.
http://wwwe.aftonbladet.se/redaktion/martin/badplats.html
(I'm hunting the 12 blue links in the left column)
Any ideas?
Thanks
Martin
Sorry, to trigger happy.
Simple solution to my own problem:
linkList = driver.find_elements_by_css_selector("a[href*='loadTestResult']")
for i in range(0,len(linkList)):
links = driver.find_elements_by_css_selector("a[href*='loadTestResult']")
links[i].click()

Django and tinymcs: getting list of image files using external_image_list_url

I am trying to get external_image_list_url to work with tinymcs and Django. My understanding is that the user will be able to see a list of his or her images when clicking on the image icon (the one with the tree). From here an image can be selected and inserted.
Am I right that it is the icon with the tree? It's the one called "image". The one called "insertimage" doesn't work at all - the icon is not displayed. It and insertfile are the only ones that aren't displayed. I'm Ok with that unless I need it for this list functionality.
First I am trying just to get any image to appear in a list. I have done the following:
Created myexternallist.js and placed it where I keep my other JS files. I can access these other files via src = "/media/js/filename.js" because of my django settings. But is this also what I should put for:
tinyMCE.init({
external_image_list_url : "/media/js/myexternallist.js",
... })
In this file it says:
var tinyMCEImageList = new Array(["Logo 1", "/media/js/photo.jpg"],);
photo.jpg is in the same folder as myexternallist.js
I have also tried just "photo.jpg" and various other combinations. Not sure if my issue has to do with my relative paths or something else altogether. I'm not sure what an absolute path should be. Right now I'm working on localhost, but won't always be.
Solved it, argh. The issue was the comma near the end of the line "var tinyMCEImageList =..."
Now it works fine with the relative urls starting with /media
The clue was given by Firebug Console, which showed me the js error. I just happened to click there, but will be using that a lot from now on!

Facebook Like button doesnt show

Im developing a RPG page and our Like Button has dissapeared.
I used the generator to create the code, and tried the diffrent versions there off non of them works.
I also used the LINTER and it shows no errors.
I asked my provider and they can find no error.
The page is http://www.wodgotham.com/ and next to the Facebook homepage link above the twitter link the Like button should be.
I have looked through the code and stared myself blind... I dont know what to do
Suggestions and assistance would be highly appriciated
You're not using the code from the generator - you're trying to load
http://connect.facebook.net/us_US/all.js - us_US is not a valid locale
The Javascript console on my browser shows the error as a 500 error from that URL, which when clicked says /* Not a valid locale. */
I believe Igy is correct. "en_US" would be the valid locale.