Detect Red Line in Html [closed] - html

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
In this table, there is red line.
http://www.data.jma.go.jp/obd/stats/etrn/view/monthly_s3_en.php?block_no=47830&view=1
How can I know if there is red line or not in the table from the html?
url = "http://www.data.jma.go.jp/obd/stats/etrn/view/monthly_s3_en.php?block_no=47830&view=1"
html = urllib2.urlopen(url).read()
soup = BeautifulSoup(html, "lxml")
table = soup.select_one("table.data2_s")
print table
how to detect red line from the program?
This table do not have red line.
http://www.data.jma.go.jp/obd/stats/etrn/view/monthly_s3_en.php?block_no=47831&view=1
I wanted to read both urls above, and test if there is red line or not using the program.

The class-names of the td-s would be a good indicator. Lined td-s have a different class than non-lined. You could check for existence of the class "data_1t_0_0_0" for example.

you could use the iframe like then you could read your iframe content like this:
$('#frame').load(function () {
setTimeout(function () {
alert($('#frame').contents().find('.data_1t_0_0_1l').length);
}, 2000);
});

Related

Using jQuery - By clicking a button change the text of a div [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last month.
Improve this question
I am working on a project in CodePen editor. My problem is: How to change the text of a element each time a hit the button ?
I have an array from which I am displaying random text on a div.
Thanks!
Try this:
let quots = [
'quot1',
'quot2',
//...
];
$(document).on('click', '#button', function(){
$('#quotBox').text(quots[Math.floor(Math.random() * quots.length)]);
});
This is for single text change. Not for array.
$(document).ready(function(){
$(".txtchange").click(function(){
$("p").text("New Text!");
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<button class="txtchange">Change</button>
<p>A Simple Text.</p>

Please check a newbie's script [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Please check my script below.
Im trying to add some color to some of the text... this is what i have managed to work out thus far.. is it correct?
<center> You will be redirected to the number one proven training system in <span style="color:blue;font-weight:bold"> <span id="countdowntimer">12 </span> Seconds </span> </center>
<script type="text/javascript">
var timeleft = 12;
var downloadTimer = setInterval(function(){
timeleft--;
document.getElementById("countdowntimer").textContent = timeleft;
if(timeleft <= 0)
clearInterval(downloadTimer);
},1000);
Yes, the text of the countdown is blue if that is what you mean. Ifyou want to change the color when the timer runs out try something like...
if(timeleft <= 0)
clearInterval(downloadTimer);
document.getElementById("countdowntimer").style = "color:red";
You might find tools like https://jsfiddle.net/vnjgngo1/ helpful in the future. In this fiddle you can paste your code and html in two separate blocks.

How can I code something that can find the title on a website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
How can I code something that goes to a website and looks for the title tag then shows that data?
Try this:
HTML
<div id="hi"></div>
JS (with JQuery)
$.ajax({
url:'https://crossorigin.me/' +
'https://myurl.com',
type:'GET',
success: function(data){
var x = "";
x = data.replace(/[^]*<title>/,"");
x = x.replace(/<\/title>[^]*/,"")
$("#hi").html(x);
}
});
Demo: https://jsfiddle.net/d4ewfs79/3/

Firefox can't show pictures? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I made a website. In this website I want to show pictures dynamically.
It works very well in Chrome. However, I can't see the pictures in FireFox.
My code as follows:
the value of directory is pictures\Tom\2014-08-14-01-52-01\beautiful.jpg
function addpictures(array){
var frame = document.getElementById("show_pictures");
for(var i=0;i<array.length;i++){
var index = array[i].PICTURE.indexOf("pictures");
directory=array[i].PICTURE.substring(index,array[i].PICTURE.length);
var node = document.createElement("div");
// the value of directory is "pictures\Tom\2014-08-14-01-52-01\beautiful.jpg"
node.innerHTML = '<img src='+directory+' width="800" height="600" alt="\"/><br/><br/>';
frame.insertBefore(node);
}
}
<div id="show_pictures" align="center">
<p id="description"></p>
</div>
URLs use forward slashes, not backslashes.
Chrome is kind enough to fix that for you, which is why you didn't notice this earlier.
try
./pictures/Tom/2014-08-14-01-52-01/beautiful.jpg

Is there a way to edit the styling of the suggestions given when typing in an input tag? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
As the question suggests, is there a way to edit the styling of the drop down list of previously inputted text when typing in an input tag?
That is browser specific so no. Instead, you could build a custom system where you save the previously entered values in 'local storage' via javascript and then use an auto-complete library to display the previous entries how you like.
Some example code:
http://jsfiddle.net/R2TGL/
<input type="text" id="savedInput"/>
window.onload = function(){
$('#savedInput').autocomplete({
source:JSON.parse(localStorage.previousInputs)
});
$('#savedInput').change(function(){
if( localStorage.previousInputs == undefined ) {
localStorage.previousInputs = JSON.stringify([]);
}
var prevArray = JSON.parse(localStorage.previousInputs);
prevArray.push($(this).val());
localStorage.previousInputs = JSON.stringify(prevArray);
$('#savedInput').autocomplete({
source:JSON.parse(localStorage.previousInputs)
});
});
}