calling different html pages using href - html

I'm trying to call different HTML pages through href in tag after running flask file .But it's giving
Not found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. where am i going wrong.
` index.html
<section>
<nav>
<ul>
<li><a href="index.html" class="button js-button" role="button">
<i class="fa fa-file" aria-hidden="true"></i> File </a></li>
<br><br>
<li><i class="fa fa-file-image-o" aria-hidden="true"></i> Image</li>
<br><br>
<li><i class="fa fa-pencil fa-fw" aria-hidden="true"></i> Text </li>
</ul>
</nav>
`
app.py
app = Flask(__name__)
app.secret_key = 'random string'
#app.config['UPLOAD_FOLDER'] = 'templates/'
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
#app.route('/')
def home():
return render_template('index.html')

Try this:
<a href="{{ url_for('index.html') }}" class="button js-button" role="button">
More about templating can be found here: http://flask.pocoo.org/docs/1.0/templating/

Related

xpath Located <p> but return None

I'm using selenium.webdriver chrome to crawl data from my website, and want to get the location from visitors.
I have successfully located the <p> label which contains 'location', but it return None.
Need help here. Many Thanks
I have tried .replace(u'\xa0', u' ') and .remove_space(location).strip() but it returns NoneType object has no attribute 'replace'
my python code is below
location=browser.find_element_by_xpath('//div[#class="module contact_module expanded"]//p[1]').get_attribute('text')
print(location)
location=location.replace(u'\xa0', u' ')
location=location.remove_space(location).strip()
html is here
<div class="module contact_module expanded">
<div class="module-header">
<ul class="actions">
<li><i class="icon-collapse-alt" data-expand="icon-expand-alt" data-collapse="icon-collapse-alt"></i></li>
</ul>
<h2>Contact <span>Edit</span></h2>
</div>
<div class="module-content contact-module">
<h4>Email / Phone / Social</h4>
<ul class="contact-list unstyled">
<li class="contact-email">
<i class="fa fa-envelope"></i> df#hotmail.com
</li>
<li class="contact-phone empty_row"><i class="fa fa-phone"></i> (blank)</li>
</ul>
<h4>Location</h4>
<p>Boondall, Queensland, Australia</p>
<h4>Timezone</h4>
<p>Australia/Brisbane</p>
</div>
</div>
I expected 'Boondall, Queensland, Australia' but the actual output is None
Try this
location=browser.find_element_by_xpath('//div[#class="module contact_module expanded"]//p[1]').text

How to link social media icons without text inside WordPress post?

Is it possible to link Social media icons inside WordPress post without text?
I have used below code in WordPress Visual composer text module:
<i class="fa fa-facebook" aria-hidden="true"></i>
<i class="fa fa-google-plus" aria-hidden="true"></i>
<i class="fa fa-twitter" aria-hidden="true"></i>
<i class="fa fa-instagram" aria-hidden="true"></i>
After updating the post, the links changed as:
<i class="fa fa-facebook" aria-hidden="true"></i>
<i class="fa fa-google-plus" aria-hidden="true"></i>
<i class="fa fa-twitter" aria-hidden="true"></i>
<i class="fa fa-instagram" aria-hidden="true"></i>
Can you try with Raw HTML module in the visual composer?
Ideally you'd want to create a shortcode and insert it using VC
Create the shortcode like this:
function social_media_shortcode( $atts, $content ) {
$a = shortcode_atts( array(
), $atts );
ob_start();
?>
<div class="vc-social-media">
social items go here
</div>
<?php
return ob_get_clean();
}
add_shortcode( 'social-media', 'social_media_shortcode' );
Then register the shortcode in VC like this:
add_action( 'vc_before_init', 'socialMediaVC' );
function socialMediaVC() {
vc_map( array(
"name" => "My Social Media Shortcode",
"base" => "vc-social-media",
"class" => "vc-social-media",
"category" => "Content",
"params" => array(
)
));
}
Now you'll have your own Visual Composer object that you can add.
Also, are you using VC for Posts or for Pages?

Typescript/Angular 2 doesn't display html into a ternary

The following will display it as text (with<\i class.. backslash and without ) and not as HTML, probably very simple, but I can't find it :(
<div *ngFor="let facility of facilities;">
{{facility['freewifi'] || facility['paidwifi'] ? '<\i class="fa fa-wifi fa-fw" aria-hidden="true"><\/i> :' : '' }}
</div>
Answer:
<i *ngIf="facility['freewifi'] || facility['paidwifi']" class="fa fa-wifi fa-fw" aria-hidden="true"></i>
Use *ngIf instead:
<i *ngIf="facility['freewifi'] || facility['paidwifi']" class="fa fa-wifi fa-fw" aria-hidden="true"></i>

"Text not allowed in element ul in this context"

Text not allowed in element ul in this context
I do not understand this error message from the markup validation service and I have been unable to find an answer.
My code is here:
<ul class="blog-meta">
<li><p><i class="fa fa-user"></i> Admin</p></li> |
<li><p><i class="fa fa-clock-o"></i> April 24th,2014</p></li> |
<li><p><i class="fa fa-tags"></i>creative , wordpress</p></li> |
<li><p><i class="fa fa-comments"></i> 0 Comments</p></li>
</ul>
I guess this error is due to this "|" remove it and validate it again.
To solve this write it inside <li> </li>
<ul class="blog-meta">
<li><p><i class="fa fa-user"></i> Admin | </p></li>
</ul>

Converting Html.action link to a regular link

I have the following code generated by default from asp.net mvc
#Html.ActionLink("Details", "Details", new { item.ORG_ID })
But I am using an open source web template where I can display a user friendly button such as:-
<a class="btn btn-success" href="#">
<i class="icon-zoom-in icon-white"></i>
View
</a>
So my question is ; how I can convert the html.actionlink to be <A> link
Regards
<a class="btn btn-success" href="#Url.Action("Details", new { item.ORG_ID })">
<i class="icon-zoom-in icon-white"></i>
View
</a>